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

Added limit parameter for ical exports

parent 7cd46306
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,8 @@ def get_responsible(): ...@@ -58,7 +58,8 @@ def get_responsible():
def ical_all(): def ical_all():
return export_lectures(query('''SELECT lectures.*, "course" AS sep, courses.* return export_lectures(query('''SELECT lectures.*, "course" AS sep, courses.*
FROM lectures JOIN courses ON courses.id = lectures.course_id 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') get_responsible(), 'videoag_all.ics')
@app.route('/internal/ical/user/<int:user>') @app.route('/internal/ical/user/<int:user>')
...@@ -70,8 +71,8 @@ def ical_user(user): ...@@ -70,8 +71,8 @@ def ical_user(user):
JOIN courses ON courses.id = lectures.course_id JOIN courses ON courses.id = lectures.course_id
JOIN responsible ON responsible.course_id = courses.id JOIN responsible ON responsible.course_id = courses.id
WHERE NOT norecording AND NOT external AND responsible.user_id = ? WHERE NOT norecording AND NOT external AND responsible.user_id = ?
ORDER BY time DESC LIMIT 1000''', user), get_responsible(), ORDER BY time DESC LIMIT ?''', user, request.values.get('limit', 1000)),
'videoag_%s.ics'%username) get_responsible(), 'videoag_%s.ics'%username)
@app.route('/internal/ical/notuser/<int:user>') @app.route('/internal/ical/notuser/<int:user>')
@calperm @calperm
...@@ -82,8 +83,8 @@ def ical_notuser(user): ...@@ -82,8 +83,8 @@ def ical_notuser(user):
JOIN courses ON courses.id = lectures.course_id JOIN courses ON courses.id = lectures.course_id
LEFT JOIN responsible ON (responsible.course_id = courses.id AND responsible.user_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 WHERE NOT norecording AND NOT external AND responsible.user_id IS NULL
ORDER BY time DESC LIMIT 1000''', user), get_responsible(), ORDER BY time DESC LIMIT ?''', user, request.values.get('limit', 1000)),
'videoag_not_%s.ics'%username) get_responsible(), 'videoag_not_%s.ics'%username)
@app.route('/internal/ical/course/<course>') @app.route('/internal/ical/course/<course>')
@calperm @calperm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment