Fix SQL queries

This commit is contained in:
Finn Stutzenstein 2022-03-06 09:53:34 +01:00
parent b31f83e214
commit d7641c2da4
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS emails (
);
-- Make emails unique by lower-case comparison
CREATE UNIQUE INDEX email_unique_idx on emails (LOWER(email));
CREATE UNIQUE INDEX IF NOT EXISTS email_unique_idx on emails (LOWER(email));
CREATE TABLE IF NOT EXISTS users (
id serial PRIMARY KEY,

View File

@ -93,7 +93,7 @@ def reset_or_create_user(cur, email, hash, is_admin):
user_id = user_id[0]
# update User
cur.execute(
"UPDATE users SET passwordhash=%s, is_admin=%s, enabled=%s can_receive=%s WHERE id=%s", # noqa
"UPDATE users SET passwordhash=%s, is_admin=%s, enabled=%s, can_receive=%s WHERE id=%s", # noqa
[hash, is_admin, True, True, user_id],
)
print(