Skip to content
Snippets Groups Projects
Commit 70ee7f44 authored by Julian Rother's avatar Julian Rother
Browse files

Return 404 when no chapters are found (#161)

parent 2840f461
No related branches found
No related tags found
No related merge requests found
...@@ -579,6 +579,8 @@ def suggest_chapter(lectureid): ...@@ -579,6 +579,8 @@ def suggest_chapter(lectureid):
@app.route('/chapters/<int:lectureid>') @app.route('/chapters/<int:lectureid>')
def chapters(lectureid): def chapters(lectureid):
chapters = query("SELECT * FROM chapters WHERE lecture_id = ? and visible ORDER BY time DESC", lectureid) chapters = query("SELECT * FROM chapters WHERE lecture_id = ? and visible ORDER BY time DESC", lectureid)
if not chapters:
return 'No chapters found', 404
last = None last = None
for c in chapters: for c in chapters:
c['start'] = c['time'] c['start'] = c['time']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment