Skip to content
Snippets Groups Projects
Commit 07f925df authored by Andreas Valder's avatar Andreas Valder
Browse files

added error handling to chapters if the wrong time format is used and no referrer is sent

parent 435c1303
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,10 @@ def suggest_chapter(lectureid):
time= timedelta(hours=x.hour,minutes=x.minute,seconds=x.second).total_seconds()
time = int(time)
except ValueError:
if 'ref' in request.values:
flash('Falsches Zeitformat, "%H:%M:%S" wird erwartet. Z.B. "01:39:42" für eine Kapitel bei Stunde 1, Minute 39, Sekunde 42')
return redirect(request.values['ref'])
return 'Wrong time format, "%H:%M:%S" is expected', 400
submitter = None
if not ismod():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment