diff --git a/apps/api/schedule.py b/apps/api/schedule.py index 3c3d78cd2..29e971f3c 100644 --- a/apps/api/schedule.py +++ b/apps/api/schedule.py @@ -216,10 +216,10 @@ def post(self): if payload["youtube"]["enabled"]: if payload["youtube"]["urls"]: # Please do not overwrite existing youtube urls + youtube_url = payload["youtube"]["urls"][0] + if not youtube_url.startswith("https://www.youtube.com/watch"): + abort(406, message="youtube url must start with https://www.youtube.com/watch") if not proposal.youtube_url: - youtube_url = payload["youtube"]["urls"][0] - if not youtube_url.startswith("https://www.youtube.com/watch"): - abort(406, message="youtube url must start with https://www.youtube.com/watch") # c3voc will send us a list, even though we only have one # video. app.logger.info(f"C3VOC webhook set youtube_url for {proposal.id=} to {youtube_url}")