From 217480309a1a224a4aa261b9246e112bd678b88d Mon Sep 17 00:00:00 2001 From: bart-maykin Date: Wed, 11 Dec 2024 00:35:45 +0100 Subject: [PATCH 1/2] :art: changed AppGroupQuerySet app_link set to view_only --- django_admin_index/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/django_admin_index/models.py b/django_admin_index/models.py index 00b4ac3..59c1d0d 100644 --- a/django_admin_index/models.py +++ b/django_admin_index/models.py @@ -86,6 +86,7 @@ def as_list(self, request, include_remaining=True): "app_label": app.slug, "admin_url": app_link.link, "active": request.path.startswith(app_link.link), + "view_only": True, } ) active = request.path.startswith(app_link.link) From 00dc6e89439bd664e1b70f9d9889e7f487a7a79c Mon Sep 17 00:00:00 2001 From: bart-maykin Date: Wed, 11 Dec 2024 15:43:22 +0100 Subject: [PATCH 2/2] :white_check_mark: updated app_link tests to include the view_only=True --- tests/unit/test_app_link.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/test_app_link.py b/tests/unit/test_app_link.py index 9175869..8db3ced 100644 --- a/tests/unit/test_app_link.py +++ b/tests/unit/test_app_link.py @@ -59,6 +59,7 @@ def test_as_list_structure(self): "name": self.app_link.name, "app_label": self.app_group.slug, "admin_url": self.app_link.link, + "view_only": True, }, ) @@ -180,6 +181,7 @@ def test_dashboard_active_link_only_delete_permission(self): "name": self.app_link.name, "app_label": self.app_group.slug, "admin_url": self.app_link.link, + "view_only": True, }, ) @@ -208,6 +210,7 @@ def test_dashboard_active_link_only_add_permission(self): "name": self.app_link.name, "app_label": self.app_group.slug, "admin_url": self.app_link.link, + "view_only": True, }, ) @@ -236,6 +239,7 @@ def test_dashboard_active_link_only_change_permission(self): "name": self.app_link.name, "app_label": self.app_group.slug, "admin_url": self.app_link.link, + "view_only": True, }, )