Skip to content

Commit

Permalink
Improve multiple admin app handling
Browse files Browse the repository at this point in the history
  • Loading branch information
darklow committed Oct 24, 2016
1 parent ee2164d commit 11f95a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions suit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ def get_config_instance(app_name=None):
:rtype: DjangoSuitConfig()
"""
try:
return apps.get_app_config(app_name or 'suit')
config = apps.get_app_config(app_name or 'suit')
if isinstance(config, DjangoSuitConfig):
return config
except LookupError:
return apps.get_app_config('suit')
pass
return apps.get_app_config('suit')


#: :type: DjangoSuitConfig()
Expand Down
2 changes: 1 addition & 1 deletion suit/templatetags/suit_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def suit_body_class(value, current_app):
css_classes = []
config_vars_to_add = ['toggle_changelist_top_actions', 'form_submit_on_right']
for each in config_vars_to_add:
if getattr(config.get_config(None, current_app), each):
if getattr(config.get_config(None, current_app), each, None):
css_classes.append('suit_%s' % each)
return ' '.join(css_classes)

Expand Down

0 comments on commit 11f95a9

Please sign in to comment.