mirror of
https://github.com/ae-utbm/sith3.git
synced 2024-06-13 18:21:55 +00:00
Added back the permission denied
This commit is contained in:
parent
aedb490922
commit
6c64411920
|
@ -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)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user