aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2014-09-18 19:13:47 +0100
committerTom Christie2014-09-18 19:13:47 +0100
commit1e9ea377e3f0521ec5d9c21527cfad3c7626baaa (patch)
tree2c4445ac8da414ab442d4fe66f97cd463a3f65eb
parentddbd3cb659d4f5d2777c73e9c2f2a8563d0d2c5d (diff)
parent7f758d1cf694c9227a1f55df400ff81e4bce2956 (diff)
downloaddjango-rest-framework-1e9ea377e3f0521ec5d9c21527cfad3c7626baaa.tar.bz2
Merge pull request #1887 from pipermerriam/piper/decorate_as_view_response_from_viewsets
Fix missing CSRF exemption on viewsets
-rw-r--r--rest_framework/viewsets.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/viewsets.py b/rest_framework/viewsets.py
index bb5b304e..84b4bd8d 100644
--- a/rest_framework/viewsets.py
+++ b/rest_framework/viewsets.py
@@ -20,6 +20,7 @@ from __future__ import unicode_literals
from functools import update_wrapper
from django.utils.decorators import classonlymethod
+from django.views.decorators.csrf import csrf_exempt
from rest_framework import views, generics, mixins
@@ -89,7 +90,7 @@ class ViewSetMixin(object):
# resolved URL.
view.cls = cls
view.suffix = initkwargs.get('suffix', None)
- return view
+ return csrf_exempt(view)
def initialize_request(self, request, *args, **kargs):
"""