From 5995df3b34f407d615a1ae859ad00ba7340e9841 Mon Sep 17 00:00:00 2001 From: Jonty Wareing Date: Sat, 15 Jun 2024 14:42:19 +0100 Subject: [PATCH] Move now-and-next feed to /schedule/ Our docs say now-and-next.json lives under /schedule/ but it is actually in the root. All our other feeds are in /schedule/ so we should just move it there for consistency - this won't break anything now as the feed returns nothing between events anyway. --- apps/base/redirects.py | 6 ++++++ apps/schedule/feeds.py | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/base/redirects.py b/apps/base/redirects.py index 092f12595..2e92cd480 100644 --- a/apps/base/redirects.py +++ b/apps/base/redirects.py @@ -36,3 +36,9 @@ def wave_talks(): @base.route("/wave/SiNE") def sine(): return redirect("https://wiki-archive.emfcamp.org/2014/wiki/SiNE") + + +@base.route("/now-and-next.json") +@base.route("/upcoming.json") +def old_now_next_feed(): + return redirect(url_for("schedule.now_and_next_json"), code=301) diff --git a/apps/schedule/feeds.py b/apps/schedule/feeds.py index 3144c8e7b..59cd597fe 100644 --- a/apps/schedule/feeds.py +++ b/apps/schedule/feeds.py @@ -172,9 +172,8 @@ def favourites_ical(): return Response(cal.to_ical(), mimetype="text/calendar") -@schedule.route("/now-and-next.json") -@schedule.route("/upcoming.json") -def upcoming(): +@schedule.route("/schedule/now-and-next.json") +def now_and_next_json(): return Response( json.dumps(_get_upcoming(request.args)), mimetype="application/json" )