aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/generics.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/rest_framework/generics.py b/rest_framework/generics.py
index a6f68657..a62da00b 100644
--- a/rest_framework/generics.py
+++ b/rest_framework/generics.py
@@ -398,10 +398,11 @@ class GenericAPIView(views.APIView):
if method not in self.allowed_methods:
continue
- cloned_request = clone_request(request, method)
+ original_request = self.request
+ self.request = clone_request(request, method)
try:
# Test global permissions
- self.check_permissions(cloned_request)
+ self.check_permissions(self.request)
# Test object permissions
if method == 'PUT':
try:
@@ -419,6 +420,8 @@ class GenericAPIView(views.APIView):
# appropriate metadata about the fields that should be supplied.
serializer = self.get_serializer()
actions[method] = serializer.metadata()
+ finally:
+ self.request = original_request
if actions:
ret['actions'] = actions