From f633f1c2a95a64c16d452c1d7d1acaea8b203d96 Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Wed, 11 Dec 2024 10:07:21 +0100 Subject: [PATCH] fix black --- server/planning/events/events.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/planning/events/events.py b/server/planning/events/events.py index 50fca7256..b5ad499a2 100644 --- a/server/planning/events/events.py +++ b/server/planning/events/events.py @@ -364,7 +364,10 @@ def _validate_dates(self, updates, original=None): if not start_date or not end_date: raise SuperdeskApiError(message="Event START DATE and END DATE are mandatory.") - if dates.get("no_end_time") == True and end_date.date() < get_local_date(dates.get("start"), dates.get("tz")).date(): + if ( + dates.get("no_end_time") == True + and end_date.date() < get_local_date(dates.get("start"), dates.get("tz")).date() + ): raise SuperdeskApiError(message="END TIME should be after START TIME") elif dates.get("no_end_time") != True and end_date < start_date: raise SuperdeskApiError(message="END TIME should be after START TIME") @@ -1037,4 +1040,4 @@ def set_planning_schedule(event): def get_local_date(date: datetime, tz: str) -> datetime: - return date.astimezone(pytz.timezone(tz)) \ No newline at end of file + return date.astimezone(pytz.timezone(tz))