From a7bffd9540bc523548079eebd1b6e0c86c9ad51f Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Thu, 8 Jun 2023 14:25:47 -0400
Subject: [PATCH] fix: get timeslot_pk from the request's timeslot_id parameter

---
 program/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/views.py b/program/views.py
index 520e6f27..8e60e1c2 100644
--- a/program/views.py
+++ b/program/views.py
@@ -869,11 +869,11 @@ class APINoteViewSet(
     def _get_timeslot(self):
         # TODO: Once we remove nested routes, timeslot ownership
         #       should be checked in a permission class.
-        timeslot_pk = self.request.data.get("timeslot", None)
+        timeslot_pk = self.request.data.get("timeslot_id", None)
         if timeslot_pk is None:
             timeslot_pk = get_values(self.kwargs, "timeslot_pk")
         if timeslot_pk is None:
-            raise ValidationError({"timeslot": [_("This field is required.")]}, code="required")
+            raise ValidationError({"timeslot_id": [_("This field is required.")]}, code="required")
         qs = TimeSlot.objects.all()
         if not self.request.user.is_superuser:
             qs = qs.filter(show__owners=self.request.user)
-- 
GitLab