SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 632131fc authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Correct: raise instead of return

parent 0940388c
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,7 @@ def subsidy_attachment(request, subsidy_id, attachment_id): ...@@ -85,7 +85,7 @@ def subsidy_attachment(request, subsidy_id, attachment_id):
attachment = get_object_or_404(SubsidyAttachment.objects, attachment = get_object_or_404(SubsidyAttachment.objects,
subsidy__id=subsidy_id, id=attachment_id) subsidy__id=subsidy_id, id=attachment_id)
if not attachment.visible_to_user(request.user): if not attachment.visible_to_user(request.user):
return PermissionDenied raise PermissionDenied
content_type, encoding = mimetypes.guess_type(attachment.attachment.path) content_type, encoding = mimetypes.guess_type(attachment.attachment.path)
content_type = content_type or 'application/octet-stream' content_type = content_type or 'application/octet-stream'
response = HttpResponse(attachment.attachment.read(), content_type=content_type) response = HttpResponse(attachment.attachment.read(), content_type=content_type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment