This commit is contained in:
Kara Engelhardt
2026-08-11 09:54:14 +02:00
parent 291a1dcd53
commit 16d654ebaf
3 changed files with 134 additions and 101 deletions
+4 -3
View File
@@ -196,9 +196,10 @@ class LayoutPreviewView(EventPermissionRequiredMixin, View):
fname, mimet, data = platform.generate(layout, p)
resp = HttpResponse(data, content_type=mimet)
ftype = fname.split(".")[-1]
resp["Content-Disposition"] = (
'attachment; filename="ticket-preview.{}"'.format(ftype)
)
if not mimet.startswith("text/"):
resp["Content-Disposition"] = (
'attachment; filename="ticket-preview.{}"'.format(ftype)
)
return resp