diff options
Diffstat (limited to 'ishtar_common/context_processors.py')
-rw-r--r-- | ishtar_common/context_processors.py | 7 |
1 files changed, 4 insertions, 3 deletions
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 ): |