mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Postgres doesn't like booleans
This commit is contained in:
parent
fe56138142
commit
b5d33a656f
@ -106,12 +106,12 @@ class RegistrationStore(SQLBaseStore):
|
|||||||
" upgrade_ts = ?,"
|
" upgrade_ts = ?,"
|
||||||
" is_guest = ?"
|
" is_guest = ?"
|
||||||
" WHERE name = ?",
|
" WHERE name = ?",
|
||||||
[password_hash, now, make_guest, user_id])
|
[password_hash, now, 1 if make_guest else 0, user_id])
|
||||||
else:
|
else:
|
||||||
txn.execute("INSERT INTO users "
|
txn.execute("INSERT INTO users "
|
||||||
"(name, password_hash, creation_ts, is_guest) "
|
"(name, password_hash, creation_ts, is_guest) "
|
||||||
"VALUES (?,?,?,?)",
|
"VALUES (?,?,?,?)",
|
||||||
[user_id, password_hash, now, make_guest])
|
[user_id, password_hash, now, 1 if make_guest else 0])
|
||||||
except self.database_engine.module.IntegrityError:
|
except self.database_engine.module.IntegrityError:
|
||||||
raise StoreError(
|
raise StoreError(
|
||||||
400, "User ID already taken.", errcode=Codes.USER_IN_USE
|
400, "User ID already taken.", errcode=Codes.USER_IN_USE
|
||||||
|
Loading…
Reference in New Issue
Block a user