diff options
-rw-r--r-- | ishtar_common/models.py | 6 | ||||
-rw-r--r-- | ishtar_common/views.py | 8 | ||||
-rw-r--r-- | ishtar_common/wizards.py | 3 |
3 files changed, 8 insertions, 9 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 8d6278151..5d48dd813 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1696,8 +1696,10 @@ def get_current_profile(force=False): def cached_site_changed(sender, **kwargs): get_current_profile(force=True) - from ishtar_common.menus import menu - menu.reinit_menu_for_all_user() + from ishtar_common.menus import Menu + MAIN_MENU = Menu(None) + MAIN_MENU.init() + MAIN_MENU.reinit_menu_for_all_user() post_save.connect(cached_site_changed, sender=IshtarSiteProfile) diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 5266f6cd7..e5fdff2fe 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -465,13 +465,9 @@ def update_current_item(request, item_type=None, pk=None): return HttpResponse('ok') -MAIN_MENU = None - - def check_permission(request, action_slug, obj_id=None): - if not MAIN_MENU: - MAIN_MENU = Menu(None) - MAIN_MENU.init() + MAIN_MENU = Menu(None) + MAIN_MENU.init() if action_slug not in MAIN_MENU.items: # TODO return True diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index cc0371982..dcad096cf 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -391,7 +391,8 @@ class Wizard(NamedUrlWizardView): if key == "DELETE" and value: is_deleted = True # no display when no label or no value - if not lbl.strip() or value is None or value == '': + if not lbl or not lbl.strip() or value is None \ + or value == '': continue if key in self.translated_keys: value = _(value) |