Skip to content

Commit

Permalink
fix timestamp on postgres (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
talvasconcelos authored Mar 7, 2024
1 parent 4f5fe80 commit 662587d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ async def delete_event_tickets(event_id: str) -> None:
async def purge_unpaid_tickets(event_id: str) -> None:
time_diff = datetime.now() - timedelta(hours=24)
await db.execute(
"""
DELETE FROM events.ticket WHERE event = ? AND paid = false AND time < ?
f"""
DELETE FROM events.ticket WHERE event = ? AND paid = false AND time < {db.timestamp_placeholder}
""",
(
event_id,
time_diff,
time_diff.timestamp(),
),
)

Expand Down

0 comments on commit 662587d

Please sign in to comment.