Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
fix async/await consentresource (#5585)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 14, 2020
2 parents cca9f58 + b491468 commit f7a85a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/5585.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Synapse can now handle RestServlets that return coroutines.
4 changes: 3 additions & 1 deletion synapse/rest/consent/consent_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import jinja2
from jinja2 import TemplateNotFound

from twisted.internet import defer

from synapse.api.errors import NotFoundError, StoreError, SynapseError
from synapse.config import ConfigError
from synapse.http.server import (
Expand Down Expand Up @@ -139,7 +141,7 @@ async def _async_render_GET(self, request):
else:
qualified_user_id = UserID(username, self.hs.hostname).to_string()

u = await self.store.get_user_by_id(qualified_user_id)
u = await defer.maybeDeferred(self.store.get_user_by_id, qualified_user_id)
if u is None:
raise NotFoundError("Unknown user")

Expand Down

0 comments on commit f7a85a4

Please sign in to comment.