remove infinite loop when output plugin provides a URI for a whole order (#5474)

This commit is contained in:
✨ Q (it/its) ✨
2025-09-23 18:26:38 +02:00
committed by GitHub
parent e694d3ca14
commit 7037f348bf
3 changed files with 18 additions and 13 deletions

View File

@@ -711,11 +711,15 @@ class OrderDownload(AsyncAction, OrderView):
)
return resp
elif isinstance(value, CachedCombinedTicket):
resp = FileResponse(value.file.file, content_type=value.type)
resp['Content-Disposition'] = 'attachment; filename="{}-{}-{}{}"'.format(
self.request.event.slug.upper(), self.order.code, self.output.identifier, value.extension
)
return resp
if value.type == 'text/uri-list':
resp = HttpResponseRedirect(value.file.file.read())
return resp
else:
resp = FileResponse(value.file.file, content_type=value.type)
resp['Content-Disposition'] = 'attachment; filename="{}-{}-{}{}"'.format(
self.request.event.slug.upper(), self.order.code, self.output.identifier, value.extension
)
return resp
else:
return redirect(self.get_self_url())