Did some other modifications

This commit is contained in:
Joan
2025-09-16 23:00:28 +02:00
parent 2bfdb539be
commit 65b8542791
4 changed files with 80 additions and 7 deletions

View File

@@ -641,5 +641,22 @@ def get_all_invoice_ids(raffle_id):
except Exception as e:
logger.error(f"Error getting invoice IDs for raffle {raffle_id}: {e}")
return []
finally:
conn.close()
def delete_reservation_timestamp(invoice_id):
"""Clears the reservation_timestamp for a participant by invoice_id."""
conn = connect_db()
cur = conn.cursor()
try:
cur.execute(
"UPDATE participants SET reservation_timestamp=NULL WHERE invoice_id=? AND step='waiting_for_payment'",
(invoice_id,)
)
conn.commit()
logger.info(f"Cleared reservation_timestamp for invoice {invoice_id}")
except Exception as e:
logger.error(f"Error clearing reservation_timestamp for invoice {invoice_id}: {e}")
conn.rollback()
finally:
conn.close()