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
...@@ -11,7 +11,10 @@ def suggest_chapter(lectureid): ...@@ -11,7 +11,10 @@ def suggest_chapter(lectureid):
time= timedelta(hours=x.hour,minutes=x.minute,seconds=x.second).total_seconds() time= timedelta(hours=x.hour,minutes=x.minute,seconds=x.second).total_seconds()
time = int(time) time = int(time)
except ValueError: except ValueError:
flash('Falsches Zeitformat, "%H:%M:%S" wird erwartet. Z.B. "01:39:42" für eine Kapitel bei Stunde 1, Minute 39, Sekunde 42') 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 submitter = None
if not ismod(): if not ismod():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment