From b85fbb536f144650f6bd432cb621770534f46c02 Mon Sep 17 00:00:00 2001
From: Julian Rother <julianr@fsmpi.rwth-aachen.de>
Date: Sun, 16 Oct 2016 18:41:39 +0200
Subject: [PATCH] Made invisible chapters visible to moderators

---
 server.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server.py b/server.py
index 3d6a540..d67fa0c 100644
--- a/server.py
+++ b/server.py
@@ -578,7 +578,7 @@ def suggest_chapter(lectureid):
 
 @app.route('/chapters/<int: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 OR ?) ORDER BY time DESC", lectureid, ismod())
 	if not chapters:
 		return 'No chapters found', 404
 	last = None
-- 
GitLab