diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index d8479d74d..627f33ea5 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -16,6 +16,10 @@ Added - Mark endpoint ``upload_config_deprecated`` as deprecated and to be removed after ``1. 1. 2025`` +Changed +------- +- Change ``UploadConfig`` type to ``APIView`` + =================== 40.1.0 - 2024-07-09 diff --git a/resolwe/api_urls.py b/resolwe/api_urls.py index b69ecbe47..e6d8fa1a4 100644 --- a/resolwe/api_urls.py +++ b/resolwe/api_urls.py @@ -26,9 +26,6 @@ api_router.register(r"relation", RelationViewSet) api_router.register(r"descriptorschema", DescriptorSchemaViewSet) api_router.register(r"storage", StorageViewSet) -api_router.register(r"upload/config", UploadConfig, basename="upload_config") -# TODO: The view below is deprecated and must be removed on 1. 1. 2025. -api_router.register(r"upload_config", UploadConfig, basename="upload_config_deprecated") api_router.register(r"task", BackgroundTaksViewSet, basename="backgroundtask") api_router.register(r"annotation_field", AnnotationFieldViewSet) api_router.register(r"annotation_preset", AnnotationPresetViewSet) @@ -38,8 +35,9 @@ urlpatterns = [ path("api/", include((api_router.urls, "resolwe-api"), namespace="resolwe-api")), path( - "api/upload/credentials", - UploadCredentials.as_view(), - name="upload_credentials", + "api/upload/credentials", UploadCredentials.as_view(), name="upload_credentials" ), + path("api/upload/config", UploadConfig.as_view(), name="upload_config"), + # TODO: The view below is deprecated and must be removed on 1. 1. 2025. + path("api/upload_config", UploadConfig.as_view(), name="upload_config_deprecated"), ] diff --git a/resolwe/storage/views.py b/resolwe/storage/views.py index a1f38a3c5..a7ad5fae7 100644 --- a/resolwe/storage/views.py +++ b/resolwe/storage/views.py @@ -24,7 +24,6 @@ from rest_framework import serializers from rest_framework.response import Response from rest_framework.views import APIView -from rest_framework.viewsets import ViewSet from resolwe.flow.models import Data from resolwe.flow.models.collection import Collection @@ -84,12 +83,12 @@ def get(self, request, *args, **kwargs): return Response(self.serializer_class(response).data) -class UploadConfig(ViewSet): +class UploadConfig(APIView): """Get the upload configuration.""" serializer_class = UploadConfigSerializer - def list(self, request): + def get(self, request, *args, **kwargs): """Return the JSON representing the upload configuration. The returning object is JSON representation of the dictionary with the