diff options
author | David Baker <dbkr@matrix.org> | 2014-11-20 17:49:48 +0000 |
---|---|---|
committer | David Baker <dbkr@matrix.org> | 2014-11-20 17:49:48 +0000 |
commit | f1c7f8e8131d6e5531e23e3bc2cd57ab7d1881ae (patch) | |
tree | b1ebd402c0805f475500c9f36a0356322bf26f13 /synapse/storage/registration.py | |
parent | Separate out the matrix http client completely because just about all of its ... (diff) | |
parent | Fix pep8 codestyle warnings (diff) | |
download | synapse-f1c7f8e8131d6e5531e23e3bc2cd57ab7d1881ae.tar.xz |
Merge branch 'develop' into http_client_refactor
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r-- | synapse/storage/registration.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py index 1f89d77344..4d15005c9e 100644 --- a/synapse/storage/registration.py +++ b/synapse/storage/registration.py @@ -75,7 +75,9 @@ class RegistrationStore(SQLBaseStore): "VALUES (?,?,?)", [user_id, password_hash, now]) except IntegrityError: - raise StoreError(400, "User ID already taken.", errcode=Codes.USER_IN_USE) + raise StoreError( + 400, "User ID already taken.", errcode=Codes.USER_IN_USE + ) # it's possible for this to get a conflict, but only for a single user # since tokens are namespaced based on their user ID @@ -83,8 +85,8 @@ class RegistrationStore(SQLBaseStore): "VALUES (?,?)", [txn.lastrowid, token]) def get_user_by_id(self, user_id): - query = ("SELECT users.name, users.password_hash FROM users " - "WHERE users.name = ?") + query = ("SELECT users.name, users.password_hash FROM users" + " WHERE users.name = ?") return self._execute( self.cursor_to_dict, query, user_id @@ -120,10 +122,10 @@ class RegistrationStore(SQLBaseStore): def _query_for_auth(self, txn, token): sql = ( - "SELECT users.name, users.admin, access_tokens.device_id " - "FROM users " - "INNER JOIN access_tokens on users.id = access_tokens.user_id " - "WHERE token = ?" + "SELECT users.name, users.admin, access_tokens.device_id" + " FROM users" + " INNER JOIN access_tokens on users.id = access_tokens.user_id" + " WHERE token = ?" ) cursor = txn.execute(sql, (token,)) |