diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-11-20 16:24:00 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-11-20 16:24:00 +0000 |
commit | 32090aee169aafc9da4efa176b50a5fc8ede68d2 (patch) | |
tree | c7606c2aecdce27c83e0e2dc95393a95761c7934 /synapse/handlers/profile.py | |
parent | Merge branch 'master' into develop (diff) | |
download | synapse-32090aee169aafc9da4efa176b50a5fc8ede68d2.tar.xz |
Add a few missing yields, Move deferred lists inside PreserveLoggingContext because they don't interact well with the logging contexts
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r-- | synapse/handlers/profile.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 7853bf5098..814b3b68fe 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -17,6 +17,7 @@ from twisted.internet import defer from synapse.api.errors import SynapseError, AuthError, CodeMessageException from synapse.api.constants import Membership +from synapse.util.logcontext import PreserveLoggingContext from ._base import BaseHandler @@ -46,7 +47,7 @@ class ProfileHandler(BaseHandler): ) def registered_user(self, user): - self.store.create_profile(user.localpart) + return self.store.create_profile(user.localpart) @defer.inlineCallbacks def get_displayname(self, target_user): @@ -152,13 +153,14 @@ class ProfileHandler(BaseHandler): if not user.is_mine: defer.returnValue(None) - (displayname, avatar_url) = yield defer.gatherResults( - [ - self.store.get_profile_displayname(user.localpart), - self.store.get_profile_avatar_url(user.localpart), - ], - consumeErrors=True - ) + with PreserveLoggingContext(): + (displayname, avatar_url) = yield defer.gatherResults( + [ + self.store.get_profile_displayname(user.localpart), + self.store.get_profile_avatar_url(user.localpart), + ], + consumeErrors=True + ) state["displayname"] = displayname state["avatar_url"] = avatar_url |