diff --git a/authentik/brands/utils.py b/authentik/brands/utils.py index 6e1db26a53..5e6ef40ed3 100644 --- a/authentik/brands/utils.py +++ b/authentik/brands/utils.py @@ -9,6 +9,7 @@ from sentry_sdk.hub import Hub from authentik import get_full_version from authentik.brands.models import Brand +from authentik.tenants.models import Tenant _q_default = Q(default=True) DEFAULT_BRAND = Brand(domain="fallback") @@ -30,13 +31,14 @@ def get_brand_for_request(request: HttpRequest) -> Brand: def context_processor(request: HttpRequest) -> dict[str, Any]: """Context Processor that injects brand object into every template""" brand = getattr(request, "brand", DEFAULT_BRAND) + tenant = getattr(request, "tenant", Tenant()) trace = "" span = Hub.current.scope.span if span: trace = span.to_traceparent() return { "brand": brand, - "footer_links": request.tenant.footer_links, + "footer_links": tenant.footer_links, "sentry_trace": trace, "version": get_full_version(), }