diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/context_processors.py | 7 | ||||
-rw-r--r-- | ishtar_common/views_item.py | 5 |
2 files changed, 8 insertions, 4 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 ): diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index a6984be8e..008dbd0eb 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -114,9 +114,9 @@ LIST_FIELDS = { # key: hierarchic depth "colors": HIERARCHIC_LEVELS, "development_type": HIERARCHIC_LEVELS, "monitoring_justification": HIERARCHIC_LEVELS, - "types": HIERARCHIC_LEVELS, "documentations": HIERARCHIC_LEVELS, "excavation_technics": HIERARCHIC_LEVELS, + "treatment_types": HIERARCHIC_LEVELS, "discovery_method": 0, "discovery_status": 0, "current_status": 0, @@ -147,6 +147,9 @@ LIST_FIELDS = { # key: hierarchic depth "origin": 0, "provider": 0, "activity": 0, + "person_types": 0, + "relation_types": 0, + "types": HIERARCHIC_LEVELS, # keep it at the end to not mess with other types } HIERARCHIC_FIELDS = list(LIST_FIELDS.keys()) |