From a3efd5b8c7d6e9494be37ae1c42b8531233d15e3 Mon Sep 17 00:00:00 2001 From: Florian Knappers <73856313+JJFlorian@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:16:41 +0200 Subject: [PATCH] added csrf exempt --- api/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/views.py b/api/views.py index b9554c3..89ef91a 100644 --- a/api/views.py +++ b/api/views.py @@ -1,6 +1,8 @@ from django.contrib.auth import logout from django.contrib.auth.models import User from django.shortcuts import redirect +from django.utils.decorators import method_decorator +from django.views.decorators.csrf import csrf_exempt from django_filters.rest_framework import DjangoFilterBackend from rest_framework import generics, permissions, status, views, viewsets from rest_framework.decorators import action @@ -136,6 +138,7 @@ def get(self, request, *args, **kwargs): """List of all Import Tasks.""" return self.list(request, *args, **kwargs) + @method_decorator(csrf_exempt) def post(self, request): """ Initialize an import task by posting a BRO object. @@ -225,6 +228,7 @@ def get(self, request, *args, **kwargs): """List of all Upload Tasks.""" return self.list(request, *args, **kwargs) + @method_decorator(csrf_exempt) def post(self, request): """ Initialize an upload task by posting the bro_domain, registration_type, request_type, and the sourcedocument_data