diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2016-07-26 16:57:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-26 16:57:53 +0100 |
commit | 2452611d0f0163e7b9c531b48fce11a6dc7e1537 (patch) | |
tree | d2067b5f2fbfcc69f7303c3fa567082a5d9469b6 /synapse/handlers/register.py | |
parent | Fix typo (diff) | |
parent | Add `create_requester` function (diff) | |
download | synapse-2452611d0f0163e7b9c531b48fce11a6dc7e1537.tar.xz |
Merge pull request #953 from matrix-org/rav/requester
Add `create_requester` function
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r-- | synapse/handlers/register.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py index 94b19d0cb0..b9b5880d64 100644 --- a/synapse/handlers/register.py +++ b/synapse/handlers/register.py @@ -14,18 +14,19 @@ # limitations under the License. """Contains functions for registering clients.""" +import logging +import urllib + from twisted.internet import defer -from synapse.types import UserID, Requester +import synapse.types from synapse.api.errors import ( AuthError, Codes, SynapseError, RegistrationError, InvalidCaptchaError ) -from ._base import BaseHandler -from synapse.util.async import run_on_reactor from synapse.http.client import CaptchaServerHttpClient - -import logging -import urllib +from synapse.types import UserID +from synapse.util.async import run_on_reactor +from ._base import BaseHandler logger = logging.getLogger(__name__) @@ -410,8 +411,9 @@ class RegistrationHandler(BaseHandler): if displayname is not None: logger.info("setting user display name: %s -> %s", user_id, displayname) profile_handler = self.hs.get_handlers().profile_handler + requester = synapse.types.create_requester(user) yield profile_handler.set_displayname( - user, Requester(user, token, False), displayname + user, requester, displayname ) defer.returnValue((user_id, token)) |