From 142f37faaf7e6d2bd13f95b7fba550b8d3b1f7ff Mon Sep 17 00:00:00 2001 From: heinzel Date: Tue, 28 Apr 2020 10:53:54 +0200 Subject: [PATCH] FIX: dav_submission: timezone parsing error with CEST The timezone within metadata.txt will now be written as Europe/Berlin instead of CET or CEST, because pytz does not recognize CEST and thus will raise an UnknownTimezoneError. --- dav_submission/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dav_submission/views.py b/dav_submission/views.py index a1159b0..fec4589 100644 --- a/dav_submission/views.py +++ b/dav_submission/views.py @@ -63,7 +63,7 @@ class ListView(generic.ListView): if mo is not None: metadata['group'] = mo.group(1) continue - mo = re.match(r'^Datum: ([0-9]{2}.[0-9]{2}.[0-9]{4}) ([0-9]{2}:[0-9]{2}:[0-9]{2}) (.*)$', line) + mo = re.match(r'^Datum: ([0-9]{2}.[0-9]{2}.[0-9]{4}) ([0-9]{2}:[0-9]{2}:[0-9]{2})[\s]*(.*)$', line) if mo is not None: date_str = mo.group(1) time_str = mo.group(2) @@ -226,7 +226,7 @@ Beschreibung: """ metadata_format_kwargs = { 'date': timezone.localtime(now).strftime('%d.%m.%Y'), - 'time': timezone.localtime(now).strftime('%H:%M:%S %Z'), + 'time': timezone.localtime(now).strftime('%H:%M:%S') + ' ' + timezone.get_current_timezone_name(), 'name': form.cleaned_data['name'], 'email_address': form.cleaned_data['email_address'], 'group': form.cleaned_data['group'],