mirror of
https://github.com/suitenumerique/docs
synced 2026-04-21 13:37:20 +00:00
fixup! ✨(back) add endpoint checking media status
This commit is contained in:
parent
7fe3287a14
commit
309710ca29
2 changed files with 3 additions and 3 deletions
|
|
@ -1322,7 +1322,7 @@ class DocumentViewSet(
|
|||
|
||||
if key not in document.attachments:
|
||||
return drf.response.Response(
|
||||
{"detail": "Media not found"},
|
||||
{"detail": "Attachment missing"},
|
||||
status=drf.status.HTTP_404_NOT_FOUND,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ def test_api_documents_media_check_key_parameter_not_related_to_document():
|
|||
{"key": f"{document.id!s}/attachments/unknown.jpg"},
|
||||
)
|
||||
assert response.status_code == 404
|
||||
assert response.json() == {"detail": "Media not found"}
|
||||
assert response.json() == {"detail": "Attachment missing"}
|
||||
|
||||
|
||||
def test_api_documents_media_check_anonymous_public_document():
|
||||
|
|
@ -179,7 +179,7 @@ def test_api_documents_media_check_connected_document_media_not_related():
|
|||
f"/api/v1.0/documents/{document.id!s}/media-check/", {"key": key}
|
||||
)
|
||||
assert response.status_code == 404
|
||||
assert response.json() == {"detail": "Media not found"}
|
||||
assert response.json() == {"detail": "Attachment missing"}
|
||||
|
||||
|
||||
def test_api_documents_media_check_media_missing_on_storage():
|
||||
|
|
|
|||
Loading…
Reference in a new issue