Skip to content

Commit fed1df6

Browse files
committed
fix issue #72 - adding prioriy to app settings
1 parent a7bfc23 commit fed1df6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

django_daisy/admin.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ def _build_app_dict(self, request, label=None):
9090

9191
for app_label, app_info in app_dict.items():
9292
# Add icon and divider title to each app
93-
app_info["icon"] = getattr(apps.get_app_config(app_label), "icon", "")
94-
app_info["divider_title"] = getattr(
95-
apps.get_app_config(app_label), "divider_title", ""
96-
)
93+
app_config = apps.get_app_config(app_label)
94+
get_attr = lambda name, default="": getattr(app_config, name, default)
95+
96+
app_info["icon"] = get_attr("icon")
97+
app_info["divider_title"] = get_attr("divider_title")
98+
app_info["priority"] = get_attr("priority", 0)
9799

98100
if app_label in override_apps_config:
99101
app_info.update(override_apps_config[app_label])

0 commit comments

Comments
 (0)