SciPost Code Repository

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

Debug subsidy att view for anonymous users; resolves SCIPOST-GY

parent 1c2f690d
No related branches found
No related tags found
No related merge requests found
...@@ -291,7 +291,7 @@ def subsidy_attachment_toggle_public_visibility(request, attachment_id): ...@@ -291,7 +291,7 @@ def subsidy_attachment_toggle_public_visibility(request, attachment_id):
def subsidy_attachment(request, subsidy_id, attachment_id): 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 (request.user.is_authenticated and attachment.visible_to_user(request.user)):
raise 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'
......
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