Commit e36154b5 authored by Andreas Valder's avatar Andreas Valder
Browse files

fixed more of the endpoint renaming

parent a9d53b87
......@@ -81,7 +81,7 @@ def course_id(id):
courses = query('SELECT * FROM courses WHERE ((handle = ?) or id = ?) AND (? OR visible)', id, id, ismod())
if not courses:
flash('Diese Veranstaltung existiert nicht!')
return app.view_functions['videos'](), 404
return app.view_functions['course'](), 404
lectures = query('SELECT * FROM lectures WHERE course_id = ? AND (? OR visible)', courses[0]['id'], ismod())
videos = query('''
SELECT videos.*, (videos.downloadable AND courses.downloadable) as downloadable, formats.description AS format_description
......@@ -105,13 +105,13 @@ def play(id):
videos = query('SELECT * FROM videos WHERE lecture_id = ? AND (? OR visible)', id, ismod())
if not lectures:
flash('Diese Vorlesung existiert nicht!')
return app.view_functions['videos'](), 404
return app.view_functions['course'](), 404
if not videos:
flash('Zu dieser Vorlesung wurden noch keine Videos veröffentlicht!')
courses = query('SELECT * FROM courses WHERE id = ? AND (? OR (visible AND listed))', lectures[0]['course_id'], ismod())
if not courses:
flash('Diese Veranstaltung existiert nicht!')
return app.view_functions['videos'](), 404
return app.view_functions['course'](), 404
return render_template('play.html', course=courses[0], lecture=lectures[0], videos=videos)
@app.route('/search')
......
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