summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorPatrik Oldsberg <patrik.oldsberg@ericsson.com>2016-10-04 22:32:58 +0200
committerPatrik Oldsberg <patrik.oldsberg@ericsson.com>2016-10-06 22:12:32 +0200
commit7b5546d0776d8d238f4c8775ea8878d92ecc2527 (patch)
tree2c4a7587045704cf21c37d20194d42e0e4c2adc7 /synapse/handlers
parenthandlers/profile: added admin override for set_displayname and set_avatar_url (diff)
downloadsynapse-7b5546d0776d8d238f4c8775ea8878d92ecc2527.tar.xz
rest/client/v1/register: use the correct requester in createUser
Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/register.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 19329057d5..7e119f13b1 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -19,7 +19,6 @@ import urllib
 
 from twisted.internet import defer
 
-import synapse.types
 from synapse.api.errors import (
     AuthError, Codes, SynapseError, RegistrationError, InvalidCaptchaError
 )
@@ -370,7 +369,7 @@ class RegistrationHandler(BaseHandler):
         defer.returnValue(data)
 
     @defer.inlineCallbacks
-    def get_or_create_user(self, localpart, displayname, duration_in_ms,
+    def get_or_create_user(self, requester, localpart, displayname, duration_in_ms,
                            password_hash=None):
         """Creates a new user if the user does not exist,
         else revokes all previous access tokens and generates a new one.
@@ -417,9 +416,8 @@ 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, displayname
+                user, requester, displayname, by_admin=True,
             )
 
         defer.returnValue((user_id, token))