Fix updating immutable request dictionary.

Django's `QueryDict`s are immutable during normal running, and so they
must be copied if any updates are to be made to them. In testing,
though, `request.DATA._mutable` is `True`, so tests can falsely pass.
This commit is contained in:
Peter Fogg
2015-06-10 11:12:25 -04:00
parent 3c2bfc70a3
commit d74bb36634

View File

@@ -300,7 +300,7 @@ class TeamsListView(GenericAPIView):
if course_key and not has_team_api_access(request.user, course_key):
return Response(status=status.HTTP_403_FORBIDDEN)
data = request.DATA
data = request.DATA.copy()
data['course_id'] = course_key
serializer = CourseTeamCreationSerializer(data=data)