diff --git a/api/views.py b/api/views.py index 3e913b7..f86a578 100644 --- a/api/views.py +++ b/api/views.py @@ -1,4 +1,5 @@ from django.contrib.auth import logout +from django.http import HttpResponseRedirect from django.shortcuts import redirect from django.urls import reverse from django_filters.rest_framework import DjangoFilterBackend @@ -137,12 +138,7 @@ def post(self, request): ) full_url = request.build_absolute_uri(url) - return Response( - { - "message": f"Succesfully received the import taks request. Check {full_url} for the status of the import task." - }, - status=status.HTTP_201_CREATED, - ) + return HttpResponseRedirect(full_url) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) @@ -244,12 +240,7 @@ def post(self, request): ) full_url = request.build_absolute_uri(url) - return Response( - { - "message": f"Succesfully received the upload taks request. Check {full_url} for the status of the import task." - }, - status=status.HTTP_201_CREATED, - ) + return HttpResponseRedirect(full_url) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)