summary refs log tree commit diff
path: root/synapse/server_notices
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-16 17:32:22 +0100
committerNeil Johnson <neil@matrix.org>2018-08-16 17:32:22 +0100
commit51b17ec56615b710f4937e3c20208841a6591477 (patch)
tree2fb0c47b31168ce37931ad12218a07931a78e03f /synapse/server_notices
parentrefactor for readability, and reuse caching for setting tags (diff)
downloadsynapse-51b17ec56615b710f4937e3c20208841a6591477.tar.xz
flake8
Diffstat (limited to 'synapse/server_notices')
-rw-r--r--synapse/server_notices/resource_limits_server_notices.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/synapse/server_notices/resource_limits_server_notices.py b/synapse/server_notices/resource_limits_server_notices.py
index 61becca758..33625fba72 100644
--- a/synapse/server_notices/resource_limits_server_notices.py
+++ b/synapse/server_notices/resource_limits_server_notices.py
@@ -128,7 +128,7 @@ class ResourceLimitsServerNotices(object):
         server_notices_tags = tags.get(room_id)
         need_to_set_tag = True
         if server_notices_tags:
-            if server_notice_tags.get(SERVER_NOTICE_ROOM_TAG):
+            if server_notices_tags.get(SERVER_NOTICE_ROOM_TAG):
                 # tag already present, nothing to do here
                 need_to_set_tag = False
         if need_to_set_tag:
@@ -158,7 +158,7 @@ class ResourceLimitsServerNotices(object):
             pinned_state_event = yield self._state.get_current_state(
                 room_id, event_type=EventTypes.Pinned
             )
-        except AuthError as e:
+        except AuthError:
             # The user has yet to join the server notices room
             pass
 
@@ -167,7 +167,6 @@ class ResourceLimitsServerNotices(object):
             referenced_events = pinned_state_event.content.get('pinned')
 
         events = yield self._store.get_events(referenced_events)
-        event_to_remove = None
         for event_id, event in events.items():
             if event.type == EventTypes.ServerNoticeLimitReached:
                 currently_blocked = True