prepare remove duplicate usernames function

(NOT TESTED)
This commit is contained in:
Lili (Tlapka) 2022-10-25 18:58:04 +02:00
parent 75bc9f161d
commit 95acd70b85
1 changed files with 13 additions and 0 deletions

View File

@ -198,6 +198,19 @@ def whole_redeem_queue(db):
print("Error occured selecting redeem queue:", e.args[0]) print("Error occured selecting redeem queue:", e.args[0])
def remove_duplicate_usernames(db, user_id, username):
try:
cursor = db.execute(
"""UPDATE points
SET username = NULL
WHERE username = ? AND WHERE NOT id = ?""",
(username, user_id)
)
db.commit()
except Error as e:
print("Error occured removing duplicate usernames:", e.args[0])
@click.command('clear-queue') @click.command('clear-queue')
@with_appcontext @with_appcontext
def clear_queue_command(): def clear_queue_command():