Fixed Dez->Dec sql->cursor

This commit is contained in:
matthias@arch 2022-12-02 13:27:07 +01:00
parent 42e508aa0b
commit 8dedf0f4b9

View File

@ -10,7 +10,7 @@ from regina.utility.globals import user_agent_operating_systems, user_agent_brow
""" """
collect information from the access log and put it into the database collect information from the access log and put it into the database
""" """
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aut", "Sep", "Oct", "Nov", "Dez"] months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aut", "Sep", "Oct", "Nov", "Dec"]
@ -140,9 +140,9 @@ def is_user_human(cur: sql.Cursor, user_id: int):
def request_exists(cur: sql.Cursor, request: Request, user_id: int, group_id: int): def request_exists(cur: sql.Cursor, request: Request, user_id: int, group_id: int):
# get all requests from same user to same location # get all requests from same user to same location
sql.execute(f"SELECT request_id, date FROM {t_request} WHERE user_id = '{user_id}' AND group_id = '{group_id}'") cur.execute(f"SELECT request_id, date FROM {t_request} WHERE user_id = '{user_id}' AND group_id = '{group_id}'")
date0 = dt.fromtimestamp(request.time_local).strftime("%Y-%m-%d") date0 = dt.fromtimestamp(request.time_local).strftime("%Y-%m-%d")
for request_id, date1 in sql.fetchall(): for request_id, date1 in cur.fetchall():
if settings["request_is_same_on_same_day"]: if settings["request_is_same_on_same_day"]:
date1 = dt.fromtimestamp(date1).strftime("%Y-%m-%d") date1 = dt.fromtimestamp(date1).strftime("%Y-%m-%d")
if date0 == date1: if date0 == date1: