From 3bbf64d4d803e98df57f2a413f60c2d8d5b2aa21 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 22 Aug 2023 11:06:55 +0300 Subject: [PATCH 1/3] Updated response code for cloud storage preview not found 204 -> 404 --- cvat/apps/engine/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index 220502aaa505..d067908b3af8 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -2587,7 +2587,7 @@ def preview(self, request, pk): if not db_storage.has_at_least_one_manifest: result = cache.get_cloud_preview_with_mime(db_storage) if not result: - return HttpResponse(status=HTTPStatus.NO_CONTENT) + return HttpResponseNotFound('Cloud storage preview not found') return HttpResponse(result[0], result[1]) preview, mime = cache.get_or_set_cloud_preview_with_mime(db_storage) From 48c3fa9ea623250ce9fa549f87f8d43178ec3303 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 22 Aug 2023 11:08:54 +0300 Subject: [PATCH 2/3] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 664fcc0dfe30..ef46d6622d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Response code for empty cloud storage preview 204 -> 404 () - Organization now opened immediately after it is created () ### Deprecated From 6fdd7cde8787815728161fbd43d9abc584d63a65 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Tue, 22 Aug 2023 12:00:00 +0300 Subject: [PATCH 3/3] Removed unused import --- cvat/apps/engine/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index d067908b3af8..23f453e3356b 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -27,7 +27,6 @@ from django.db.models.query import Prefetch from django.http import HttpResponse, HttpResponseNotFound, HttpResponseBadRequest from django.utils import timezone -from http import HTTPStatus from drf_spectacular.types import OpenApiTypes from drf_spectacular.utils import (