From 437a7e596cc1e56fd5b84e93de61cc96ce6a862d Mon Sep 17 00:00:00 2001 From: bton Date: Wed, 13 Mar 2024 20:50:34 +0100 Subject: [PATCH] log statements --- Website/__init__.py | 24 ++++++++++++------------ Website/db.py | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Website/__init__.py b/Website/__init__.py index 3e310e1..2ffd7ce 100644 --- a/Website/__init__.py +++ b/Website/__init__.py @@ -84,26 +84,26 @@ def create_app(test_config=None): reverse_before = None reverse_after = None reverse_change = change *(-1) - elif statement == "adduser": - reverse_statement = "removeuser" + elif statement == "add_user": + reverse_statement = "remove_user" reverse_user_id = user_id reverse_before = after reverse_after = None reverse_change = None - elif statement == "removeuser": - reverse_statement = "adduser" + elif statement == "remove_user": + reverse_statement = "add_user" reverse_user_id = user_id reverse_before = None reverse_after = before reverse_change = None - elif statement == "addtag": - reverse_statement = "removetag" + elif statement == "add_tag": + reverse_statement = "remove_tag" reverse_user_id = user_id reverse_before = after reverse_after = None reverse_change = None - elif statement == "removetag": - reverse_statement = "addtag" + elif statement == "remove_tag": + reverse_statement = "add_tag" reverse_user_id = user_id reverse_before = None reverse_after = beforeaddtag @@ -381,13 +381,13 @@ def create_app(test_config=None): after = request.form["after"] change = request.form["change"] - if statement == "adduser": + if statement == "add_user": db_handler.add_user(after) - elif statement == "removeuser": + elif statement == "remove_user": db_handler.remove_user(user_id) - elif statement == "addtag": + elif statement == "add_tag": db_handler.add_tag(user_id, after) - elif statement == "removetag": + elif statement == "remove_tag": db_handler.remove_tag(befor) elif statement == "balance": db_handler.change_balance(user_id, change) diff --git a/Website/db.py b/Website/db.py index 91a5665..c33a458 100644 --- a/Website/db.py +++ b/Website/db.py @@ -36,7 +36,7 @@ def add_tag(user_id, tag_id): c = db.cursor() c.execute("INSERT OR IGNORE INTO tags (tagid, userid) VALUES ?, ?)", [tag_id, user_id]) db.commit() - log("addtag", after=tag_id, user_id=user_id) + log("add_tag", after=tag_id, user_id=user_id) def remove_tag(tag_id): db = get_db() @@ -44,7 +44,7 @@ def remove_tag(tag_id): c.execute("SELECT * FROM tags WHERE tagid = ?", [tag_id]) user_id = c.fetchone()[1] c.execute("DELETE FROM tags WHERE tagid = ?", [tag_id]) - log("removetag", before=tag_id, user_id=user_id) + log("remove_tag", before=tag_id, user_id=user_id) db.commit() def change_balance(user_id, change):