PDF Output: Prevent subsequent exception on permission errors

This commit is contained in:
Raphael Michel
2017-09-25 10:22:09 +02:00
parent 62b2a367ff
commit 9b3ea3656f

View File

@@ -26,7 +26,7 @@ def register_data(sender, **kwargs):
@receiver(html_head, dispatch_uid="ticketoutputpdf_html_head")
def html_head_presale(sender, request=None, **kwargs):
url = resolve(request.path_info)
if url.namespace == 'plugins:ticketoutputpdf':
if url.namespace == 'plugins:ticketoutputpdf' and getattr(request, 'organizer', None):
template = get_template('pretixplugins/ticketoutputpdf/control_head.html')
return template.render({
'request': request