Commit 14df4ac6 authored by okhin's avatar okhin

No CSRF for unlogged forms

parent 8112c3fa
Pipeline #846 failed with stages
in 48 seconds
import json
from django.views.decorators.csrf import csrf_exempt
from rest_framework import viewsets
from rest_framework.response import Response
......@@ -11,9 +14,9 @@ class FeedbackViewSet(viewsets.ViewSet):
queryset = Feedback.objects.all()
serializer_class = FeedbackSerializer
def create(self, request, campaign_pk=None):
serializer = FeedbackSerializer(
feedback = Feedback.objects.create(callee=serializer.validated_data.pop('callee'), **serializer.validated_data)
feedback = serializer.create(serializer.validated_data)
return Response(
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from rest_framework_nested import routers
......@@ -28,3 +29,9 @@ urlpatterns = [
url(r'^', include(campaign_router.urls)),
url(r'^i18n/', include('django.conf.urls.i18n'))
if settings.DEBUG:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment