From 34596c34850c146e58ee0a0a580d139ba3f36b1f Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Thu, 7 May 2015 14:18:09 +0000 Subject: [PATCH] Fixed recursion bug on menu --- orchestra/admin/dashboard.py | 4 ++-- orchestra/admin/menu.py | 5 +++-- orchestra/contrib/settings/apps.py | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/orchestra/admin/dashboard.py b/orchestra/admin/dashboard.py index 2bbbc51a..62df66f9 100644 --- a/orchestra/admin/dashboard.py +++ b/orchestra/admin/dashboard.py @@ -28,9 +28,9 @@ class OrchestraIndexDashboard(dashboard.FluentIndexDashboard): 'app_name': app_name, 'change_url': url, 'name': name, - 'title': options.get('verbose_name')}], + 'title': options.get('verbose_name_plural')}], 'name': app_name, - 'title': options.get('verbose_name'), + 'title': options.get('verbose_name_plural'), 'url': add_url, }) diff --git a/orchestra/admin/menu.py b/orchestra/admin/menu.py index 788336bd..fdef845c 100644 --- a/orchestra/admin/menu.py +++ b/orchestra/admin/menu.py @@ -1,3 +1,5 @@ +from copy import deepcopy + from admin_tools.menu import items, Menu from django.core.urlresolvers import reverse from django.utils.text import capfirst @@ -27,7 +29,6 @@ def api_link(context): return reverse('api-root') -from copy import copy def process_registry(register): def get_item(model, options): if isinstance(model, str): @@ -47,7 +48,7 @@ def process_registry(register): parent_item = childrens.get(parent) if parent_item: if not parent_item.children: - parent_item.children.append(copy(parent_item)) + parent_item.children.append(deepcopy(parent_item)) else: parent_item = get_item(parent, register[parent]) parent_item.children = [] diff --git a/orchestra/contrib/settings/apps.py b/orchestra/contrib/settings/apps.py index f93361c7..1f9f5808 100644 --- a/orchestra/contrib/settings/apps.py +++ b/orchestra/contrib/settings/apps.py @@ -13,7 +13,8 @@ class SettingsConfig(AppConfig): verbose_name = 'Settings' def ready(self): - administration.register_view('settings_setting_change', verbose_name=_("Settings"), + administration.register_view('settings_setting_change', verbose_name=_("Setting"), + verbose_name_plural=_("Settings"), icon='Multimedia-volume-control.png') @register()