#31 API POST Intervention

* adds support for proper POST of intervention
* makes /<id> optional (required for Post)
This commit is contained in:
2022-01-24 12:17:17 +01:00
parent a06eaa49fb
commit a03f9c8c78
12 changed files with 171 additions and 41 deletions

View File

@@ -8,6 +8,7 @@ Created on: 21.01.22
from django.http import JsonResponse
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from api.models import APIUserToken
from api.settings import KSP_TOKEN_HEADER_IDENTIFIER
@@ -36,6 +37,7 @@ class AbstractModelAPIView(View):
super().__init__(*args, **kwargs)
self.serializer = self.serializer()
@csrf_exempt
def dispatch(self, request, *args, **kwargs):
try:
# Fetch the proper user from the given request header token