Skip to content

Commit

Permalink
Change UploadConfig type to APIView
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorjerse committed Jul 17, 2024
1 parent aba9bab commit df217ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions resolwe/api_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"),
]
5 changes: 2 additions & 3 deletions resolwe/storage/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit df217ce

Please sign in to comment.