Skip to content

Commit

Permalink
api.schedule.ProposalC3VOCPublishingWebhook: add a bit of input valid…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
Kunsi committed Aug 31, 2024
1 parent c5f8aea commit fd040f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/api/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def post(self):

if payload["voctoweb"]["enabled"]:
if payload["voctoweb"]["frontend_url"]:
if not payload["voctoweb"]["frontend_url"].startswith('https://media.ccc.de/'):
abort(406, message="voctoweb frontend_url must start with https://media.ccc.de/")
proposal.c3voc_url = payload["voctoweb"]["frontend_url"]
proposal.video_recording_lost = False
else:
Expand All @@ -211,6 +213,9 @@ def post(self):
if payload["youtube"]["urls"]:
# Please do not overwrite existing youtube urls
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.
proposal.youtube_url = payload["youtube"]["urls"][0]
Expand Down

0 comments on commit fd040f4

Please sign in to comment.