From fcd8c820929085bb8e610c15e1bd100499c40a16 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 18 Mar 2025 08:58:40 +0100 Subject: [PATCH] Fix context processor crash on "event not found" page (PRETIXEU-BAS) (#4918) --- src/pretix/control/context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/control/context.py b/src/pretix/control/context.py index 5183b13ce1..cde58295af 100644 --- a/src/pretix/control/context.py +++ b/src/pretix/control/context.py @@ -81,13 +81,13 @@ def _default_context(request): 'DEBUG': settings.DEBUG, } _html_head = [] - if hasattr(request, 'event') and request.user.is_authenticated: + if getattr(request, 'event', None) and request.user.is_authenticated: for receiver, response in html_head.send(request.event, request=request): _html_head.append(response) ctx['html_head'] = "".join(_html_head) _js_payment_weekdays_disabled = '[]' - if getattr(request, 'event', None) and hasattr(request, 'organizer') and request.user.is_authenticated: + if getattr(request, 'event', None) and getattr(request, 'organizer', None) and request.user.is_authenticated: ctx['nav_items'] = get_event_navigation(request) if request.event.settings.get('payment_term_weekdays'):