Commit 80db6ace authored by Andreas Valder's avatar Andreas Valder

fixed too many empry rows at cut progress

parent b745fc52
......@@ -18,7 +18,6 @@ def cutprogress(user=None):
maxlecturecount = 0
for course in coursesraw:
course['lectures'] = query('SELECT lectures.title, lectures.time, FROM lectures WHERE lectures.course_id= ? AND NOT lectures.deleted AND NOT lectures.norecording ORDER BY lectures.time', course['id'])
maxlecturecount = max(len(course['lectures']),maxlecturecount)
for lecture in course['lectures']:
lecture['videos'] = query('SELECT videos.path, formats.description as formatdesc, videos.visible FROM videos JOIN formats ON (videos.video_format = WHERE videos.lecture_id = ? AND NOT videos.deleted', lecture['id'])
course['responsible'] = query('''SELECT users.*
......@@ -29,4 +28,5 @@ def cutprogress(user=None):
course['responsible'] = [{"realname": "Niemand", "id": -1}]
if not user or user in [ r['id'] for r in course['responsible'] ]:
maxlecturecount = max(len(course['lectures']),maxlecturecount)
return render_template('cutprogress.html', allsemester=allsemester, semester=semester, courses=courses, maxlecturecount=maxlecturecount, user=query('SELECT * FROM users WHERE id = ?', user)[0] if user else None)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment