diff --git a/icalexport.py b/icalexport.py index b2edf35ff51c2c3631e2a905d79bfa126c4c1e51..fa90fdb94d5753e7c64f42f007d57e762f832324 100644 --- a/icalexport.py +++ b/icalexport.py @@ -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