diff options
| author | Tom Christie | 2014-09-18 19:13:47 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-09-18 19:13:47 +0100 | 
| commit | 1e9ea377e3f0521ec5d9c21527cfad3c7626baaa (patch) | |
| tree | 2c4445ac8da414ab442d4fe66f97cd463a3f65eb | |
| parent | ddbd3cb659d4f5d2777c73e9c2f2a8563d0d2c5d (diff) | |
| parent | 7f758d1cf694c9227a1f55df400ff81e4bce2956 (diff) | |
| download | django-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.py | 3 | 
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):          """ | 
