FIX: dav_submission: timezone parsing error with CEST
All checks were successful
buildbot/tox Build done.

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.
This commit is contained in:
2020-04-28 10:53:54 +02:00
parent 74ab8af520
commit 142f37faaf

View File

@@ -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'],