Skip to content

Commit 374ea57

Browse files
committed
move frab json export to /schedule/frab-<year>.json
1 parent 0a919d6 commit 374ea57

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

apps/schedule/feeds.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,19 @@ def schedule_json(year):
4242
if not feature_enabled("SCHEDULE"):
4343
abort(404)
4444

45-
if request.args.get('format') == 'array':
46-
schedule = [_convert_time_to_str(p) for p in _get_scheduled_proposals(request.args)]
45+
schedule = [_convert_time_to_str(p) for p in _get_scheduled_proposals(request.args)]
4746

48-
# NB this is JSON in a top-level array (security issue for low-end browsers)
49-
return Response(json.dumps(schedule), mimetype="application/json")
47+
# NB this is JSON in a top-level array (security issue for low-end browsers)
48+
return Response(json.dumps(schedule), mimetype="application/json")
49+
50+
51+
@schedule.route("/schedule/frab-<int:year>.json")
52+
def schedule_frab_json(year):
53+
if year != event_year():
54+
return feed_historic(year, "frab_json")
55+
56+
if not feature_enabled("SCHEDULE"):
57+
abort(404)
5058

5159
def duration_hhmm(duration_minutes):
5260
if not duration_minutes or duration_minutes < 1:

0 commit comments

Comments
 (0)