diff options
author | Richard van der Hoff <richard@matrix.org> | 2017-10-20 16:33:15 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2017-10-20 22:14:55 +0100 |
commit | 631d7b87b50b7263a2f9a3f89fc196272011bf37 (patch) | |
tree | d0b93dc743a38764ea5d240889fbc72804786486 /synapse/handlers | |
parent | Merge pull request #2559 from matrix-org/erikj/group_id_validation (diff) | |
download | synapse-631d7b87b50b7263a2f9a3f89fc196272011bf37.tar.xz |
Remove pointless create() method
It just calls the constructor, so we may as well kill it rather than having random codepaths.
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/auth.py | 2 | ||||
-rw-r--r-- | synapse/handlers/room.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index b00446bec0..9cef9d184b 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -267,7 +267,7 @@ class AuthHandler(BaseHandler): user_id = authdict["user"] password = authdict["password"] if not user_id.startswith('@'): - user_id = UserID.create(user_id, self.hs.hostname).to_string() + user_id = UserID(user_id, self.hs.hostname).to_string() return self._check_password(user_id, password) diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 535ba9517c..e945bd35bc 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -91,7 +91,7 @@ class RoomCreationHandler(BaseHandler): if wchar in config["room_alias_name"]: raise SynapseError(400, "Invalid characters in room alias") - room_alias = RoomAlias.create( + room_alias = RoomAlias( config["room_alias_name"], self.hs.hostname, ) @@ -123,7 +123,7 @@ class RoomCreationHandler(BaseHandler): while attempts < 5: try: random_string = stringutils.random_string(18) - gen_room_id = RoomID.create( + gen_room_id = RoomID( random_string, self.hs.hostname, ) |