♻️(backend) clarify storage hook message for intentionally ignored req

Update the response message to explicitly state that certain
notifications are ignored on purpose, avoiding confusion
during debugging or log inspection.
This commit is contained in:
lebaudantoine
2026-03-12 17:00:19 +01:00
parent cb4ed3c9d7
commit f3e90c3999
2 changed files with 6 additions and 8 deletions
+4 -4
View File
@@ -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:
@@ -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):