Merge pull request #2560 from matrix-org/rav/kill_pointless_method
Remove pointless create() method
This commit is contained in:
commit
bd0d84bf92
|
@ -55,7 +55,7 @@ class EventBuilderFactory(object):
|
||||||
|
|
||||||
local_part = str(int(self.clock.time())) + i + random_string(5)
|
local_part = str(int(self.clock.time())) + i + random_string(5)
|
||||||
|
|
||||||
e_id = EventID.create(local_part, self.hostname)
|
e_id = EventID(local_part, self.hostname)
|
||||||
|
|
||||||
return e_id.to_string()
|
return e_id.to_string()
|
||||||
|
|
||||||
|
|
|
@ -267,7 +267,7 @@ class AuthHandler(BaseHandler):
|
||||||
user_id = authdict["user"]
|
user_id = authdict["user"]
|
||||||
password = authdict["password"]
|
password = authdict["password"]
|
||||||
if not user_id.startswith('@'):
|
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)
|
return self._check_password(user_id, password)
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ class RoomCreationHandler(BaseHandler):
|
||||||
if wchar in config["room_alias_name"]:
|
if wchar in config["room_alias_name"]:
|
||||||
raise SynapseError(400, "Invalid characters in room alias")
|
raise SynapseError(400, "Invalid characters in room alias")
|
||||||
|
|
||||||
room_alias = RoomAlias.create(
|
room_alias = RoomAlias(
|
||||||
config["room_alias_name"],
|
config["room_alias_name"],
|
||||||
self.hs.hostname,
|
self.hs.hostname,
|
||||||
)
|
)
|
||||||
|
@ -123,7 +123,7 @@ class RoomCreationHandler(BaseHandler):
|
||||||
while attempts < 5:
|
while attempts < 5:
|
||||||
try:
|
try:
|
||||||
random_string = stringutils.random_string(18)
|
random_string = stringutils.random_string(18)
|
||||||
gen_room_id = RoomID.create(
|
gen_room_id = RoomID(
|
||||||
random_string,
|
random_string,
|
||||||
self.hs.hostname,
|
self.hs.hostname,
|
||||||
)
|
)
|
||||||
|
|
|
@ -211,7 +211,7 @@ class LoginRestServlet(ClientV1RestServlet):
|
||||||
user_id = identifier["user"]
|
user_id = identifier["user"]
|
||||||
|
|
||||||
if not user_id.startswith('@'):
|
if not user_id.startswith('@'):
|
||||||
user_id = UserID.create(
|
user_id = UserID(
|
||||||
user_id, self.hs.hostname
|
user_id, self.hs.hostname
|
||||||
).to_string()
|
).to_string()
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ class LoginRestServlet(ClientV1RestServlet):
|
||||||
if user is None:
|
if user is None:
|
||||||
raise LoginError(401, "Invalid JWT", errcode=Codes.UNAUTHORIZED)
|
raise LoginError(401, "Invalid JWT", errcode=Codes.UNAUTHORIZED)
|
||||||
|
|
||||||
user_id = UserID.create(user, self.hs.hostname).to_string()
|
user_id = UserID(user, self.hs.hostname).to_string()
|
||||||
auth_handler = self.auth_handler
|
auth_handler = self.auth_handler
|
||||||
registered_user_id = yield auth_handler.check_user_exists(user_id)
|
registered_user_id = yield auth_handler.check_user_exists(user_id)
|
||||||
if registered_user_id:
|
if registered_user_id:
|
||||||
|
@ -444,7 +444,7 @@ class CasTicketServlet(ClientV1RestServlet):
|
||||||
if required_value != actual_value:
|
if required_value != actual_value:
|
||||||
raise LoginError(401, "Unauthorized", errcode=Codes.UNAUTHORIZED)
|
raise LoginError(401, "Unauthorized", errcode=Codes.UNAUTHORIZED)
|
||||||
|
|
||||||
user_id = UserID.create(user, self.hs.hostname).to_string()
|
user_id = UserID(user, self.hs.hostname).to_string()
|
||||||
auth_handler = self.auth_handler
|
auth_handler = self.auth_handler
|
||||||
registered_user_id = yield auth_handler.check_user_exists(user_id)
|
registered_user_id = yield auth_handler.check_user_exists(user_id)
|
||||||
if not registered_user_id:
|
if not registered_user_id:
|
||||||
|
|
|
@ -412,7 +412,7 @@ class GroupCreateServlet(RestServlet):
|
||||||
# TODO: Create group on remote server
|
# TODO: Create group on remote server
|
||||||
content = parse_json_object_from_request(request)
|
content = parse_json_object_from_request(request)
|
||||||
localpart = content.pop("localpart")
|
localpart = content.pop("localpart")
|
||||||
group_id = GroupID.create(localpart, self.server_name).to_string()
|
group_id = GroupID(localpart, self.server_name).to_string()
|
||||||
|
|
||||||
result = yield self.groups_handler.create_group(group_id, user_id, content)
|
result = yield self.groups_handler.create_group(group_id, user_id, content)
|
||||||
|
|
||||||
|
|
|
@ -131,10 +131,6 @@ class DomainSpecificString(
|
||||||
|
|
||||||
__str__ = to_string
|
__str__ = to_string
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def create(cls, localpart, domain,):
|
|
||||||
return cls(localpart=localpart, domain=domain)
|
|
||||||
|
|
||||||
|
|
||||||
class UserID(DomainSpecificString):
|
class UserID(DomainSpecificString):
|
||||||
"""Structure representing a user ID."""
|
"""Structure representing a user ID."""
|
||||||
|
|
Loading…
Reference in New Issue