Skip to content
Snippets Groups Projects
Verified Commit a7bffd95 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: get timeslot_pk from the request's timeslot_id parameter

parent 53173268
No related branches found
No related tags found
No related merge requests found
...@@ -869,11 +869,11 @@ class APINoteViewSet( ...@@ -869,11 +869,11 @@ class APINoteViewSet(
def _get_timeslot(self): def _get_timeslot(self):
# TODO: Once we remove nested routes, timeslot ownership # TODO: Once we remove nested routes, timeslot ownership
# should be checked in a permission class. # 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: if timeslot_pk is None:
timeslot_pk = get_values(self.kwargs, "timeslot_pk") timeslot_pk = get_values(self.kwargs, "timeslot_pk")
if timeslot_pk is None: 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() qs = TimeSlot.objects.all()
if not self.request.user.is_superuser: if not self.request.user.is_superuser:
qs = qs.filter(show__owners=self.request.user) qs = qs.filter(show__owners=self.request.user)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment