diff --git a/core/files/media_v2.py b/core/files/media_v2.py index 9cc8f23..00161b3 100644 --- a/core/files/media_v2.py +++ b/core/files/media_v2.py @@ -38,6 +38,8 @@ def media_urls(request, hash): 'Age': 0, 'ETag': file.hash, }) + except FileNotFoundError: + return Response(status=status.HTTP_404_NOT_FOUND) except File.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) except EmailAttachment.DoesNotExist: @@ -80,6 +82,8 @@ def thumbnail_urls(request, size, hash): 'ETag': file.hash + "_" + str(size), }) + except FileNotFoundError: + return Response(status=status.HTTP_404_NOT_FOUND) except File.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) except EmailAttachment.DoesNotExist: