From f3e90c39998cac73e8ea070f4f5ecb9af594cb9a Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Thu, 12 Mar 2026 17:00:19 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(backend)=20clarify=20storage?= =?UTF-8?q?=20hook=20message=20for=20intentionally=20ignored=20req?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the response message to explicitly state that certain notifications are ignored on purpose, avoiding confusion during debugging or log inspection. --- src/backend/core/api/viewsets.py | 8 ++++---- .../tests/recording/test_api_recordings_storage_hook.py | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/backend/core/api/viewsets.py b/src/backend/core/api/viewsets.py index aafada92..ad3e3c64 100644 --- a/src/backend/core/api/viewsets.py +++ b/src/backend/core/api/viewsets.py @@ -762,14 +762,14 @@ class RecordingViewSet( except InvalidBucketError as e: raise drf_exceptions.PermissionDenied("Invalid bucket specified") from e - except InvalidFilepathError as e: + except InvalidFilepathError: return drf_response.Response( - {"message": f"Ignore this filepath, {e}"}, + {"message": "Notification ignored."}, ) - except InvalidFileTypeError as e: + except InvalidFileTypeError: return drf_response.Response( - {"message": f"Ignore this file type, {e}"}, + {"message": "Notification ignored."}, ) try: diff --git a/src/backend/core/tests/recording/test_api_recordings_storage_hook.py b/src/backend/core/tests/recording/test_api_recordings_storage_hook.py index 008372e8..fe85cb76 100644 --- a/src/backend/core/tests/recording/test_api_recordings_storage_hook.py +++ b/src/backend/core/tests/recording/test_api_recordings_storage_hook.py @@ -133,7 +133,7 @@ def test_save_recording_filetype_error(recording_settings, mock_get_parser): ) assert response.status_code == 200 - assert response.json() == {"message": "Ignore this file type, unsupported '.json'"} + assert response.json() == {"message": "Notification ignored."} def test_save_recording_filepath_error(recording_settings, mock_get_parser): @@ -154,9 +154,7 @@ def test_save_recording_filepath_error(recording_settings, mock_get_parser): ) assert response.status_code == 200 - assert response.json() == { - "message": "Ignore this filepath, Invalid filepath structure: parent/folder/recording.jpeg" - } + assert response.json() == {"message": "Notification ignored."} def test_save_recording_unknown_recording(recording_settings, mock_get_parser, client):