From 97b660bd9c1879813677e65c8558aeda16489b94 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 10 Mar 2025 12:07:55 +0100 Subject: 🐛 person search: fix person type search (refs #6191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/context_processors.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ishtar_common/context_processors.py') diff --git a/ishtar_common/context_processors.py b/ishtar_common/context_processors.py index 3365d504e..76ac14b82 100644 --- a/ishtar_common/context_processors.py +++ b/ishtar_common/context_processors.py @@ -116,10 +116,10 @@ def get_base_context(request): menu = Menu(request.user, current_action=current_action, session=request.session) menu.init() - if is_main_page and hasattr(request.user, "ishtaruser") \ + if hasattr(request.user, "ishtaruser") \ and request.user.ishtaruser: # check password expiration date - if settings.ISHTAR_PASSWORD_EXPIRATION_DAYS and \ + if is_main_page and settings.ISHTAR_PASSWORD_EXPIRATION_DAYS and \ isinstance(settings.ISHTAR_PASSWORD_EXPIRATION_DAYS, int): key = f"{settings.PROJECT_SLUG}-password_expired-{request.user.pk}" password_expired = cache.get(key) @@ -143,7 +143,7 @@ def get_base_context(request): dct["MESSAGES"].append((msg, "warning")) # check changelog - if request.user.ishtaruser.display_news: + if is_main_page and request.user.ishtaruser.display_news: user_version = request.user.ishtaruser.latest_news_version current_version = get_changelog_version() if current_version != user_version and "changelog" not in dct["CURRENT_PATH"]: @@ -192,6 +192,7 @@ def get_base_context(request): if request.user.ishtaruser.has_permission("ishtaradmin"): dct["ADMIN"] = True if ( + is_main_page and request.user.ishtaruser.current_profile and request.user.ishtaruser.current_profile.display_pin_menu ): -- cgit v1.2.3