Skip to content
Snippets Groups Projects
Commit 1deb26e1 authored by Troy Sankey's avatar Troy Sankey
Browse files

avoid unnecessary attempt to update an immutable dict

request.data has become immutable under Django 1.11 for some reason.
Regardless, setting the 'id' key should be extraneous because we already
instruct the update method to use a specific pk (see kwargs) which
should be sufficient to locate the database record and update it.
parent 27edca3c
No related merge requests found
......@@ -46,7 +46,6 @@ class ExperimentDataViewSet(viewsets.ModelViewSet):
try:
obj = self.get_queryset().get(user=self.request.user, experiment_id=experiment_id, key=key)
self.kwargs['pk'] = obj.pk
self.request.data['id'] = obj.pk
return self.update(request, *args, **kwargs)
except ExperimentData.DoesNotExist:
pass
......
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