summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2017-10-10 15:53:34 +0100
committerDavid Baker <dave@matrix.org>2017-10-10 15:53:34 +0100
commit81a5e0073cbca1ed469fdae94150de3059e5c3e3 (patch)
tree43f64345d56e6e410c7aaff041165fb58e553641
parentDon't KeyError if no power_levels event (diff)
downloadsynapse-81a5e0073cbca1ed469fdae94150de3059e5c3e3.tar.xz
pep8
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py6
-rw-r--r--synapse/push/push_rule_evaluator.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index 05c1c5165f..425a017bdf 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -119,7 +119,7 @@ class BulkPushRuleEvaluator(object):
             # fastpath: if there's a power level event, that's all we need, and
             # not having a power level event is an extreme edge case
             pl_event = yield self.store.get_event(pl_event_id)
-            auth_events = { POWER_KEY: pl_event }
+            auth_events = {POWER_KEY: pl_event}
         else:
             auth_events_ids = yield self.auth.compute_auth_events(
                 event, context.prev_state_ids, for_verification=False,
@@ -150,7 +150,9 @@ class BulkPushRuleEvaluator(object):
             event, context
         )
 
-        (power_levels, sender_power_level) = yield self._get_power_levels_and_sender_level(event, context)
+        (power_levels, sender_power_level) = (
+            yield self._get_power_levels_and_sender_level(event, context)
+        )
 
         evaluator = PushRuleEvaluatorForEvent(
             event, len(room_members), sender_power_level, power_levels,
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py
index 5011bef4f1..3601f2d365 100644
--- a/synapse/push/push_rule_evaluator.py
+++ b/synapse/push/push_rule_evaluator.py
@@ -41,7 +41,7 @@ def _sender_notification_permission(ev, condition, sender_power_level, power_lev
     notif_levels = power_levels.get('notifications', {})
     room_notif_level = notif_levels.get(notif_level_key, 50)
 
-    return sender_power_level >= room_notif_level;
+    return sender_power_level >= room_notif_level
 
 
 def _test_ineq_condition(condition, number):