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

feat: add request to TimeslotViewset context

parent b248cee5
No related branches found
No related tags found
No related merge requests found
...@@ -1332,7 +1332,12 @@ class APITimeSlotViewSet( ...@@ -1332,7 +1332,12 @@ class APITimeSlotViewSet(
def update(self, request, *args, **kwargs): def update(self, request, *args, **kwargs):
show_pk = get_values(self.kwargs, "show_pk") show_pk = get_values(self.kwargs, "show_pk")
timeslot = self.get_object() timeslot = self.get_object()
serializer = TimeSlotSerializer(timeslot, data=request.data) serializer = TimeSlotSerializer(
timeslot,
context={"request": request}, # the serializer needs the request in the context
data=request.data,
)
if serializer.is_valid(raise_exception=True): if serializer.is_valid(raise_exception=True):
serializer.save() serializer.save()
......
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