Commit 9b9a9d27 authored by Julian Rother's avatar Julian Rother
Browse files

Added limit parameter for ical exports

parent 7cd46306
......@@ -58,7 +58,8 @@ def get_responsible():
def ical_all():
return export_lectures(query('''SELECT lectures.*, "course" AS sep, courses.*
FROM lectures JOIN courses ON courses.id = lectures.course_id
WHERE NOT norecording AND NOT external ORDER BY time DESC LIMIT 1000'''),
WHERE NOT norecording AND NOT external
ORDER BY time DESC LIMIT ?''', request.values.get('limit', 1000)),
get_responsible(), 'videoag_all.ics')
@app.route('/internal/ical/user/<int:user>')
......@@ -70,8 +71,8 @@ def ical_user(user):
JOIN courses ON courses.id = lectures.course_id
JOIN responsible ON responsible.course_id = courses.id
WHERE NOT norecording AND NOT external AND responsible.user_id = ?
ORDER BY time DESC LIMIT 1000''', user), get_responsible(),
'videoag_%s.ics'%username)
ORDER BY time DESC LIMIT ?''', user, request.values.get('limit', 1000)),
get_responsible(), 'videoag_%s.ics'%username)
@app.route('/internal/ical/notuser/<int:user>')
@calperm
......@@ -82,8 +83,8 @@ def ical_notuser(user):
JOIN courses ON courses.id = lectures.course_id
LEFT JOIN responsible ON (responsible.course_id = courses.id AND responsible.user_id = ?)
WHERE NOT norecording AND NOT external AND responsible.user_id IS NULL
ORDER BY time DESC LIMIT 1000''', user), get_responsible(),
'videoag_not_%s.ics'%username)
ORDER BY time DESC LIMIT ?''', user, request.values.get('limit', 1000)),
get_responsible(), 'videoag_not_%s.ics'%username)
@app.route('/internal/ical/course/<course>')
@calperm
......
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