Serve upload files directly from nginx

This commit is contained in:
2025-04-06 12:08:15 +02:00
parent 91b30e7550
commit 67bc49fb21
10 changed files with 65 additions and 52 deletions

View File

@ -39,7 +39,7 @@ from core.auth.mixins import (
CanViewMixin,
can_view,
)
from core.models import Notification, QuickUploadImage, SithFile, User
from core.models import Notification, SithFile, User
from core.views.mixins import AllowFragment
from core.views.widgets.ajax_select import (
AutoCompleteSelectMultipleGroup,
@ -87,7 +87,7 @@ def send_raw_file(path: Path) -> HttpResponse:
def send_file(
request: HttpRequest,
file_id: int | str,
file_class: type[SithFile | QuickUploadImage] = SithFile,
file_class: type[SithFile] = SithFile,
file_attr: str = "file",
) -> HttpResponse:
"""Send a protected file, if the user can see it.