From 61fc4ca0ca61098edd4e96ef89b62a293ff764aa Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Tue, 6 Feb 2024 22:06:46 -0400
Subject: [PATCH] fix: get the showId from the schedule in the request

---
 program/views.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/program/views.py b/program/views.py
index ba5d807a..23f96a8a 100644
--- a/program/views.py
+++ b/program/views.py
@@ -558,6 +558,9 @@ class APIScheduleViewSet(
 
         pk, show_pk = get_values(self.kwargs, "pk", "show_pk")
 
+        if show_pk is None:
+            show_pk = request.data.get("schedule").get("show_id")
+
         # Only allow creating when calling /shows/{show_pk}/schedules/ and with ehe `schedule` JSON
         # object
         if show_pk is None or "schedule" not in request.data:
-- 
GitLab