diff --git a/adminlteui/__init__.py b/adminlteui/__init__.py index 1e00a3b..faacc94 100644 --- a/adminlteui/__init__.py +++ b/adminlteui/__init__.py @@ -1,2 +1,2 @@ -version = '1.7.0' +version = '1.7.1' default_app_config = 'adminlteui.apps.AdminlteUIConfig' diff --git a/adminlteui/admin.py b/adminlteui/admin.py index f008c3d..b2da052 100644 --- a/adminlteui/admin.py +++ b/adminlteui/admin.py @@ -62,16 +62,18 @@ class Media: def changelist_view(self, request, extra_context=None): view = super().changelist_view(request, extra_context) - cl = view.context_data.get('cl') - cl.search_field_placeholder = self.search_field_placeholder - filter_specs = cl.filter_specs - - for index, filter_spec in enumerate(filter_specs): - if filter_spec.field_path in self.select2_list_filter: - # flag to use select2 - filter_spec.display_select2 = True - cl.filter_specs[index] = filter_spec - view.context_data['cl'] = cl + if hasattr(view, 'context_data'): + cl = view.context_data.get('cl', None) + if cl: + cl.search_field_placeholder = self.search_field_placeholder + filter_specs = cl.filter_specs + + for index, filter_spec in enumerate(filter_specs): + if filter_spec.field_path in self.select2_list_filter: + # flag to use select2 + filter_spec.display_select2 = True + cl.filter_specs[index] = filter_spec + view.context_data['cl'] = cl return view diff --git a/docs/about.md b/docs/about.md index 58834d4..b591e09 100644 --- a/docs/about.md +++ b/docs/about.md @@ -1,4 +1,7 @@ # ChangeLog +## [v1.7.1](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.7.0) +- fix exception when delete in changelist_view +- update docs ## [v1.7.0](https://github.com/wuyue92tree/django-adminlte-ui/releases/tag/1.7.0) - make previous & next button effective on change_list.html diff --git a/docs/guide.md b/docs/guide.md index f3cf120..b9f7a94 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -264,17 +264,19 @@ Modify apps icon & order apps/models ```python ADMINLTE_SETTINGS = { - 'example-app': { - 'icon': 'fa-desktop', - 'models': { - 'example-model': { - 'icon': 'fa-archive' - }, - 'example-model1': {} + 'apps': { + 'example-app': { + 'icon': 'fa-desktop', + 'models': { + 'example-model': { + 'icon': 'fa-archive' + }, + 'example-model1': {} + } + }, + 'auth': { + 'icon': 'fa-users' } - }, - 'auth': { - 'icon': 'fa-users' } } ``` \ No newline at end of file