re-format code

This commit is contained in:
x3005504 2022-10-11 14:07:17 +02:00
parent 9a9a7821b7
commit ec25ffe6ba

View file

@ -59,11 +59,17 @@ class ReadThroughForm(CustomForm):
"stopped_date", _("Reading stopped date cannot be before start date.")
)
current_time = datetime.datetime.now()
if stopped_date is not None and current_time.timestamp() < stopped_date.timestamp():
if (
stopped_date is not None
and current_time.timestamp() < stopped_date.timestamp()
):
self.add_error(
"stopped_date", _("Reading stopped date cannot be in the future.")
)
if finish_date is not None and current_time.timestamp() < finish_date.timestamp():
if (
finish_date is not None
and current_time.timestamp() < finish_date.timestamp()
):
self.add_error(
"finish_date", _("Reading finished date cannot be in the future.")
)