style fixes

This commit is contained in:
Lili (Tlapka) 2022-11-22 11:33:05 +01:00
parent 5d3a4c3825
commit 5e5e81114f
4 changed files with 6 additions and 7 deletions

View File

@ -68,7 +68,7 @@ def refresh_counters():
db.commit()
except Error as e:
print("Error occured deleting old counters:", e.args[0])
for redeem, redeem_info in current_app.config['REDEEMS'].items():
if redeem_info["type"] == "counter":
try:

View File

@ -20,4 +20,4 @@ def send_help():
message.append(f"!{redeem} for {redeem_info['price']} points.\n")
else:
message.append("Check the dashboard for a list of currently active redeems.")
send_chat(''.join(message))
send_chat(''.join(message))

View File

@ -55,6 +55,7 @@ def read_all_users_with_username(db, username):
print("Error occured reading points from username:", e.args[0])
print("To user:", username)
def give_points_to_user(db, user_id, points):
try:
db.execute(
@ -108,7 +109,7 @@ def add_user_to_database(db, user_id, display_name):
"INSERT INTO points(id, name, points) VALUES(?, ?, 10)",
(user_id, display_name)
)
if user is not None and user[1] == None:
if user is not None and user[1] is None:
cursor.execute(
"""UPDATE points
SET name = ?
@ -157,8 +158,6 @@ def add_to_redeem_queue(db, user_id, redeem_name, note=None):
print("To user:", user_id, " with redeem:", redeem_name, "with note:", note)
def all_counters(db):
try:
cursor = db.execute(
@ -198,7 +197,7 @@ def remove_duplicate_usernames(db, user_id, username):
"""UPDATE points
SET name = NULL
WHERE name = ? AND NOT id = ?""",
(username, user_id)
(username, user_id)
)
db.commit()
except Error as e:

View File

@ -16,7 +16,7 @@ def dashboard():
username = request.args.get("username")
if username is not None:
users = read_all_users_with_username(db, username)
else:
else:
users = []
utc_timezone = timezone.utc
return render_template('dashboard.html',