From e4267f629226332d3332bc6ceb142c17cd91246b Mon Sep 17 00:00:00 2001 From: Jyrki Launonen Date: Sat, 20 Jul 2024 12:39:07 +0300 Subject: [PATCH] Remove unnecessary if from ui text variables The _date and _time functions already check the nullity. --- kirppu/views/ui_text_utils.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kirppu/views/ui_text_utils.py b/kirppu/views/ui_text_utils.py index afaf67c..bdced79 100644 --- a/kirppu/views/ui_text_utils.py +++ b/kirppu/views/ui_text_utils.py @@ -51,10 +51,6 @@ def ui_text_vars(event) -> dict[str, typing.Any]: "event.end.date": _date(event.end_date), "event.homepage": event.home_page, "registration.end.datetime": _datetime(event.registration_end), - "registration.end.date": _date(event.registration_end) - if event.registration_end - else "", - "registration.end.time": _time(event.registration_end) - if event.registration_end - else "", + "registration.end.date": _date(event.registration_end), + "registration.end.time": _time(event.registration_end), }