From d74bb36634b6b666323a32a963e20a4288389912 Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Wed, 10 Jun 2015 11:12:25 -0400 Subject: [PATCH] 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. --- lms/djangoapps/teams/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/djangoapps/teams/views.py b/lms/djangoapps/teams/views.py index cb6bceef9a..759567d5b4 100644 --- a/lms/djangoapps/teams/views.py +++ b/lms/djangoapps/teams/views.py @@ -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)