diff --git a/modules/utils/event_utils.py b/modules/utils/event_utils.py index b40ae42..697e614 100644 --- a/modules/utils/event_utils.py +++ b/modules/utils/event_utils.py @@ -17,16 +17,16 @@ async def validate_event_validity( finish_date: datetime | None, guild_timezone: ZoneInfo, event_id: ObjectId | None = None, -) -> None: +) -> bool: if start_date > finish_date: # TODO Make a nice message await ctx.respond("Start date must be before finish date") - return + return False if start_date < datetime.now(tz=guild_timezone): # TODO Make a nice message await ctx.respond("Start date must not be in the past") - return + return False # TODO Add validation for concurrent events. # Only one event can take place at the same time. @@ -43,4 +43,6 @@ async def validate_event_validity( if (await col_events.find_one(query)) is not None: # TODO Make a nice message await ctx.respond("There can only be one active event with the same name") - return + return False + + return True