diff --git a/api/views.py b/api/views.py index 3e913b7..8f7e3e4 100644 --- a/api/views.py +++ b/api/views.py @@ -2,10 +2,12 @@ from django.shortcuts import redirect from django.urls import reverse from django_filters.rest_framework import DjangoFilterBackend +from django.http import HttpResponseRedirect from rest_framework import generics, permissions, status, views from rest_framework.response import Response from rest_framework.reverse import reverse as drf_reverse + from . import filters, mixins, models, serializers, tasks @@ -137,12 +139,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 +241,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)