Commit 3fdcba1d authored by Julian Rother's avatar Julian Rother
Browse files

Differentiated error messages on player page

parent eb3fc3d2
...@@ -451,7 +451,12 @@ def lecture(id, course=None, courseid=None): ...@@ -451,7 +451,12 @@ def lecture(id, course=None, courseid=None):
perms = query('SELECT perm.* FROM perm WHERE ((NOT perm.deleted) AND (perm.lecture_id = ? OR perm.course_id = ?))', perms = query('SELECT perm.* FROM perm WHERE ((NOT perm.deleted) AND (perm.lecture_id = ? OR perm.course_id = ?))',
lecture['id'], lecture['course_id']) lecture['id'], lecture['course_id'])
if not videos: if not videos:
flash('Zu dieser Vorlesung wurden noch keine Videos veröffentlicht!') if lecture['live'] and lecture['time'] > datetime.now()-timedelta(minutes=30) and lecture['time']-timedelta(hours=20) < datetime.now():
flash('Der Livestream beginnt um '+human_time(lecture['time'])+' Uhr.')
elif lecture['time'] > datetime.now():
flash('Diese Vorlesung hat noch nicht stattgefunden!')
else:
flash('Zu dieser Vorlesung wurden noch keine Videos veröffentlicht!')
courses = query('SELECT * FROM courses WHERE id = ? AND (? OR visible)', lecture['course_id'], ismod()) courses = query('SELECT * FROM courses WHERE id = ? AND (? OR visible)', lecture['course_id'], ismod())
if not courses: if not courses:
return render_endpoint('courses', 'Diese Veranstaltung existiert nicht!'), 404 return render_endpoint('courses', 'Diese Veranstaltung existiert nicht!'), 404
......
Supports Markdown
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