fix user_id / user confusion

This commit is contained in:
Matthew Hodgson 2018-05-04 00:53:56 +01:00
parent 383c4ae59c
commit 5c74ab4064
2 changed files with 6 additions and 6 deletions

View file

@ -178,7 +178,7 @@ class RegistrationHandler(BaseHandler):
if display_name: if display_name:
yield self.profile_handler.set_displayname( yield self.profile_handler.set_displayname(
user_id, user_id, display_name, by_admin=True, user, user, display_name, by_admin=True,
) )
if self.hs.config.user_directory_search_all_users: if self.hs.config.user_directory_search_all_users:
@ -208,7 +208,7 @@ class RegistrationHandler(BaseHandler):
) )
yield self.profile_handler.set_displayname( yield self.profile_handler.set_displayname(
user_id, user_id, user.localpart, by_admin=True, user, user, user.localpart, by_admin=True,
) )
except SynapseError: except SynapseError:
@ -257,7 +257,7 @@ class RegistrationHandler(BaseHandler):
) )
yield self.profile_handler.set_displayname( yield self.profile_handler.set_displayname(
user_id, user_id, user.localpart, by_admin=True, user, user, user.localpart, by_admin=True,
) )
defer.returnValue(user_id) defer.returnValue(user_id)
@ -308,7 +308,7 @@ class RegistrationHandler(BaseHandler):
) )
yield self.profile_handler.set_displayname( yield self.profile_handler.set_displayname(
user_id, user_id, user.localpart, by_admin=True, user, user, user.localpart, by_admin=True,
) )
except Exception as e: except Exception as e:
yield self.store.add_access_token_to_user(user_id, token) yield self.store.add_access_token_to_user(user_id, token)
@ -466,7 +466,7 @@ class RegistrationHandler(BaseHandler):
) )
if displayname is not None: if displayname is not None:
yield self.profile_handler.set_displayname( yield self.profile_handler.set_displayname(
user_id, user_id, displayname, by_admin=True, user, user, displayname, by_admin=True,
) )
else: else:
yield self._auth_handler.delete_access_tokens_for_user(user_id) yield self._auth_handler.delete_access_tokens_for_user(user_id)

View file

@ -238,7 +238,7 @@ def strip_invalid_mxid_characters(localpart):
Returns: Returns:
localpart (basestring): the localpart having been stripped localpart (basestring): the localpart having been stripped
""" """
return filter(lambda c: c not in mxid_localpart_allowed_characters, localpart) return filter(lambda c: c in mxid_localpart_allowed_characters, localpart)
class StreamToken( class StreamToken(