From bfb6b80e94eff7307a9a6a315a98018b99244cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20H=C3=A1la?= Date: Wed, 25 Dec 2024 22:32:11 +0100 Subject: [PATCH] Fix localadmin auth --- backend/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/auth.py b/backend/auth.py index bca6c67..87481d8 100644 --- a/backend/auth.py +++ b/backend/auth.py @@ -9,7 +9,7 @@ def is_superadmin(request): def is_localadmin(request): """Returns True, if the current user is Tenant-level administrator""" user = request.user - return is_superadmin(request) or user.is_localadmin + return user.is_authenticated and (is_superadmin(request) or (hasattr(user, "is_localadmin") and user.is_localadmin)) def is_authenticated(request):