mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-16 11:36:39 +01:00
Fix some tests from b1c406680f
This commit is contained in:
parent
b6dbbec019
commit
0ccc2da9bb
4 changed files with 30 additions and 21 deletions
|
|
@ -2951,17 +2951,14 @@ class TrashView(ListModelMixin, PassUserMixin):
|
|||
return Response({"result": "OK", "doc_ids": doc_ids})
|
||||
|
||||
|
||||
def serve_logo(request, filename):
|
||||
def serve_logo(request, filename=None):
|
||||
"""
|
||||
Serves the configured logo file with Content-Disposition: attachment.
|
||||
Prevents inline execution of SVGs. See GHSA-6p53-hqqw-8j62
|
||||
"""
|
||||
logger.warning("Serving app logo...")
|
||||
config = ApplicationConfiguration.objects.first()
|
||||
app_logo = config.app_logo
|
||||
|
||||
logger.warning(f"Serving logo: {app_logo}")
|
||||
|
||||
if not app_logo:
|
||||
raise Http404("No logo configured")
|
||||
|
||||
|
|
@ -2972,4 +2969,5 @@ def serve_logo(request, filename):
|
|||
app_logo.open("rb"),
|
||||
content_type=content_type,
|
||||
filename=app_logo.name,
|
||||
).as_attachment()
|
||||
as_attachment=True,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue