summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-02-10 16:30:48 +0000
committerMark Haines <mark.haines@matrix.org>2015-02-10 16:30:48 +0000
commitb085fac7353e1cd395b89f9334c8273a8e996f48 (patch)
tree140b1a6279527dbcb5b81dbd392d75777b5b3e8a /synapse/handlers
parentSign auth_chains when returned by /state/ requests (diff)
downloadsynapse-b085fac7353e1cd395b89f9334c8273a8e996f48.tar.xz
Code-style fixes
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/presence.py4
-rw-r--r--synapse/handlers/register.py13
2 files changed, 11 insertions, 6 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index cd0798c2b0..6a266ee0fe 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -658,7 +658,9 @@ class PresenceHandler(BaseHandler):
 
             observers = set(self._remote_recvmap.get(user, set()))
             if observers:
-                logger.debug(" | %d interested local observers %r", len(observers), observers)
+                logger.debug(
+                    " | %d interested local observers %r", len(observers), observers
+                )
 
             rm_handler = self.homeserver.get_handlers().room_member_handler
             room_ids = yield rm_handler.get_rooms_for_user(user)
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 4f06c487b1..0247327eb9 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -105,17 +105,20 @@ class RegistrationHandler(BaseHandler):
         # do it here.
         try:
             auth_user = UserID.from_string(user_id)
-            identicon_resource = self.hs.get_resource_for_media_repository().getChildWithDefault("identicon", None)
-            upload_resource = self.hs.get_resource_for_media_repository().getChildWithDefault("upload", None)
+            media_repository = self.hs.get_resource_for_media_repository()
+            identicon_resource = media_repository.getChildWithDefault("identicon", None)
+            upload_resource = media_repository.getChildWithDefault("upload", None)
             identicon_bytes = identicon_resource.generate_identicon(user_id, 320, 320)
             content_uri = yield upload_resource.create_content(
                 "image/png", None, identicon_bytes, len(identicon_bytes), auth_user
             )
             profile_handler = self.hs.get_handlers().profile_handler
-            profile_handler.set_avatar_url(auth_user, auth_user, ("%s#auto" % content_uri))
+            profile_handler.set_avatar_url(
+                auth_user, auth_user, ("%s#auto" % (content_uri,))
+            )
         except NotImplementedError:
-            pass # make tests pass without messing around creating default avatars
-        
+            pass  # make tests pass without messing around creating default avatars
+
         defer.returnValue((user_id, token))
 
     @defer.inlineCallbacks