Skip to content

Commit

Permalink
Merge pull request #35 from nens/changed-views
Browse files Browse the repository at this point in the history
changed auth/csrf settings views
  • Loading branch information
JJFlorian authored Apr 5, 2024
2 parents 897251b + 7afa1eb commit a219c70
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions api/views.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
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.authentication import BasicAuthentication, SessionAuthentication
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.reverse import reverse
Expand Down Expand Up @@ -130,7 +130,6 @@ class ImportTaskListView(mixins.UserOrganizationMixin, generics.ListAPIView):

queryset = models.ImportTask.objects.all().order_by("-created")
serializer_class = serializers.ImportTaskSerializer
authentication_classes = [SessionAuthentication, BasicAuthentication]
permission_classes = [permissions.IsAuthenticated]
filter_backends = [DjangoFilterBackend]
filterset_fields = "__all__"
Expand All @@ -139,7 +138,7 @@ def get(self, request, *args, **kwargs):
"""List of all Import Tasks."""
return self.list(request, *args, **kwargs)

@csrf_exempt
@method_decorator(csrf_exempt)
def post(self, request):
"""
Initialize an import task by posting a BRO object.
Expand Down Expand Up @@ -219,7 +218,6 @@ class UploadTaskListView(mixins.UserOrganizationMixin, generics.ListAPIView):

serializer_class = serializers.UploadTaskSerializer
queryset = models.UploadTask.objects.all().order_by("-created")
authentication_classes = [SessionAuthentication, BasicAuthentication]
permission_classes = [permissions.IsAuthenticated]

filter_backends = [DjangoFilterBackend]
Expand All @@ -229,7 +227,7 @@ def get(self, request, *args, **kwargs):
"""List of all Upload Tasks."""
return self.list(request, *args, **kwargs)

@csrf_exempt
@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
Expand Down

0 comments on commit a219c70

Please sign in to comment.