Fixed time comparison bug

This commit is contained in:
2025-04-25 00:25:00 +02:00
parent 2763fddc49
commit 3e6cb75457

View File

@@ -20,7 +20,11 @@ async def validate_event_status(
await ctx.respond("This event was cancelled.") await ctx.respond("This event was cancelled.")
return return
if event.starts <= datetime.now(tz=ZoneInfo("UTC")) <= event.ends: if (
event.starts.replace(tzinfo=ZoneInfo("UTC"))
<= datetime.now(tz=ZoneInfo("UTC"))
<= event.ends.replace(tzinfo=ZoneInfo("UTC"))
):
# TODO Make a nice message # TODO Make a nice message
await ctx.respond("Ongoing events cannot be modified.") await ctx.respond("Ongoing events cannot be modified.")
return return