style fixes
This commit is contained in:
parent
5d3a4c3825
commit
5e5e81114f
|
@ -68,7 +68,7 @@ def refresh_counters():
|
||||||
db.commit()
|
db.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
print("Error occured deleting old counters:", e.args[0])
|
print("Error occured deleting old counters:", e.args[0])
|
||||||
|
|
||||||
for redeem, redeem_info in current_app.config['REDEEMS'].items():
|
for redeem, redeem_info in current_app.config['REDEEMS'].items():
|
||||||
if redeem_info["type"] == "counter":
|
if redeem_info["type"] == "counter":
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -20,4 +20,4 @@ def send_help():
|
||||||
message.append(f"!{redeem} for {redeem_info['price']} points.\n")
|
message.append(f"!{redeem} for {redeem_info['price']} points.\n")
|
||||||
else:
|
else:
|
||||||
message.append("Check the dashboard for a list of currently active redeems.")
|
message.append("Check the dashboard for a list of currently active redeems.")
|
||||||
send_chat(''.join(message))
|
send_chat(''.join(message))
|
||||||
|
|
|
@ -55,6 +55,7 @@ def read_all_users_with_username(db, username):
|
||||||
print("Error occured reading points from username:", e.args[0])
|
print("Error occured reading points from username:", e.args[0])
|
||||||
print("To user:", username)
|
print("To user:", username)
|
||||||
|
|
||||||
|
|
||||||
def give_points_to_user(db, user_id, points):
|
def give_points_to_user(db, user_id, points):
|
||||||
try:
|
try:
|
||||||
db.execute(
|
db.execute(
|
||||||
|
@ -108,7 +109,7 @@ def add_user_to_database(db, user_id, display_name):
|
||||||
"INSERT INTO points(id, name, points) VALUES(?, ?, 10)",
|
"INSERT INTO points(id, name, points) VALUES(?, ?, 10)",
|
||||||
(user_id, display_name)
|
(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(
|
cursor.execute(
|
||||||
"""UPDATE points
|
"""UPDATE points
|
||||||
SET name = ?
|
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)
|
print("To user:", user_id, " with redeem:", redeem_name, "with note:", note)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def all_counters(db):
|
def all_counters(db):
|
||||||
try:
|
try:
|
||||||
cursor = db.execute(
|
cursor = db.execute(
|
||||||
|
@ -198,7 +197,7 @@ def remove_duplicate_usernames(db, user_id, username):
|
||||||
"""UPDATE points
|
"""UPDATE points
|
||||||
SET name = NULL
|
SET name = NULL
|
||||||
WHERE name = ? AND NOT id = ?""",
|
WHERE name = ? AND NOT id = ?""",
|
||||||
(username, user_id)
|
(username, user_id)
|
||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
except Error as e:
|
except Error as e:
|
||||||
|
|
|
@ -16,7 +16,7 @@ def dashboard():
|
||||||
username = request.args.get("username")
|
username = request.args.get("username")
|
||||||
if username is not None:
|
if username is not None:
|
||||||
users = read_all_users_with_username(db, username)
|
users = read_all_users_with_username(db, username)
|
||||||
else:
|
else:
|
||||||
users = []
|
users = []
|
||||||
utc_timezone = timezone.utc
|
utc_timezone = timezone.utc
|
||||||
return render_template('dashboard.html',
|
return render_template('dashboard.html',
|
||||||
|
|
Loading…
Reference in New Issue