Fixed time comparison bug
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user