Added back the permission denied

This commit is contained in:
Julien Constant 2023-04-08 23:58:28 +02:00
parent aedb490922
commit 6c64411920
2 changed files with 2 additions and 5 deletions

View File

@ -26,6 +26,7 @@ from django.utils.translation import gettext_lazy as _
from django.http import Http404, HttpResponse
from wsgiref.util import FileWrapper
from django.urls import reverse
from django.core.exceptions import PermissionDenied
from django import forms
import os
@ -59,7 +60,7 @@ def send_file(request, file_id, file_class=SithFile, file_attr="file"):
).exists()
)
):
return forbidden(request, _("You are not allowed to view this file"))
raise PermissionDenied
name = f.__getattribute__(file_attr).name
filepath = os.path.join(settings.MEDIA_ROOT, name)

View File

@ -2523,10 +2523,6 @@ msgstr "Fichiers"
msgid "File not found"
msgstr "Fichier introuvable"
#: core/views/files.py:64
msgid "You are not allowed to view this file"
msgstr "Vous n'êtes pas autorisé à voir ce fichier"
#: core/templates/core/base.jinja:202 core/templates/core/user_tools.jinja:109
msgid "Pedagogy"
msgstr "Pédagogie"