From 7b39718bd1a04e2f70b390166ec944861d9a7b8d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 3 Jun 2021 22:40:01 +0200 Subject: [PATCH] tenants: fix fallback for unittests Signed-off-by: Jens Langhammer --- authentik/tenants/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentik/tenants/utils.py b/authentik/tenants/utils.py index 6be7548f1..df89edcdb 100644 --- a/authentik/tenants/utils.py +++ b/authentik/tenants/utils.py @@ -23,8 +23,9 @@ def get_tenant_for_request(request: HttpRequest) -> Tenant: def context_processor(request: HttpRequest) -> dict[str, Any]: """Context Processor that injects tenant object into every template""" + tenant = getattr(request, "tenant", Tenant(domain="fallback")) return { - "tenant": request.tenant, + "tenant": tenant, "ak_version": __version__, "footer_links": CONFIG.y("authentik.footer_links"), }