Skip to content

Commit

Permalink
fix:global_(search/add)_models overriding
Browse files Browse the repository at this point in the history
Now the instance variables can be override by [].
  • Loading branch information
cgcgbcbc committed Apr 16, 2014
1 parent effe5c0 commit d50eea0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions xadmin/plugins/topnav.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def block_top_navbar(self, context, nodes):
search_models = []

site_name = self.admin_site.name
models = self.global_search_models or self.admin_site._registry.keys()
if self.global_search_models == None:
models = self.admin_site._registry.keys()
else:
models = self.global_search_models

for model in models:
app_label = model._meta.app_label
Expand All @@ -45,9 +48,11 @@ def block_top_navmenu(self, context, nodes):
add_models = []

site_name = self.admin_site.name
models = self.global_search_models or self.admin_site._registry.keys()

models = self.global_add_models or self.admin_site._registry.keys()
if self.global_add_models == None:
models = self.admin_site._registry.keys()
else:
models = self.global_add_models
for model in models:
app_label = model._meta.app_label

Expand Down

0 comments on commit d50eea0

Please sign in to comment.