diff options
author | Erik Johnston <erik@matrix.org> | 2015-11-05 15:35:17 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-11-05 15:35:17 +0000 |
commit | 347146be2928d36937d44130748ead296ed28f94 (patch) | |
tree | 4960b2026946b938ffd35f371508cdb7adadde3e /synapse/storage/registration.py | |
parent | Merge branch 'release-v0.10.1' of github.com:matrix-org/synapse into develop (diff) | |
parent | Open up /events to anonymous users for room events only (diff) | |
download | synapse-347146be2928d36937d44130748ead296ed28f94.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r-- | synapse/storage/registration.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py index b454dd5b3a..2e5eddd259 100644 --- a/synapse/storage/registration.py +++ b/synapse/storage/registration.py @@ -102,13 +102,14 @@ class RegistrationStore(SQLBaseStore): 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 - txn.execute( - "INSERT INTO access_tokens(id, user_id, token)" - " VALUES (?,?,?)", - (next_id, user_id, token,) - ) + if token: + # it's possible for this to get a conflict, but only for a single user + # since tokens are namespaced based on their user ID + txn.execute( + "INSERT INTO access_tokens(id, user_id, token)" + " VALUES (?,?,?)", + (next_id, user_id, token,) + ) def get_user_by_id(self, user_id): return self._simple_select_one( |