From 70d9de94c2efb08a241c8b4dbc4e5f3c6e5f56c1 Mon Sep 17 00:00:00 2001 From: Lukas Juhrich Date: Wed, 19 Jan 2022 20:41:26 +0100 Subject: [PATCH] Use `DateTimeField.format` correctly --- sipa/forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sipa/forms.py b/sipa/forms.py index bcc2e2e5..cdc2e886 100644 --- a/sipa/forms.py +++ b/sipa/forms.py @@ -123,10 +123,12 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def __call__(self, *args, **kwargs): + assert isinstance(self.format, list) + format = self.format[0] if self.min is not None: - kwargs['min'] = self.min.strftime(self.format) + kwargs['min'] = self.min.strftime(format) if self.max is not None: - kwargs['max'] = self.max.strftime(self.format) + kwargs['max'] = self.max.strftime(format) return super().__call__(*args, **kwargs)