Skip to content

Commit 09af377

Browse files
authored
Merge pull request #94 from maykinmedia/small-change/applink-change-admin-index-view-only-true
Applinks in admin as read_only
2 parents b559e5f + 00dc6e8 commit 09af377

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

django_admin_index/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def as_list(self, request, include_remaining=True):
8686
"app_label": app.slug,
8787
"admin_url": app_link.link,
8888
"active": request.path.startswith(app_link.link),
89+
"view_only": True,
8990
}
9091
)
9192
active = request.path.startswith(app_link.link)

tests/unit/test_app_link.py

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def test_as_list_structure(self):
5959
"name": self.app_link.name,
6060
"app_label": self.app_group.slug,
6161
"admin_url": self.app_link.link,
62+
"view_only": True,
6263
},
6364
)
6465

@@ -180,6 +181,7 @@ def test_dashboard_active_link_only_delete_permission(self):
180181
"name": self.app_link.name,
181182
"app_label": self.app_group.slug,
182183
"admin_url": self.app_link.link,
184+
"view_only": True,
183185
},
184186
)
185187

@@ -208,6 +210,7 @@ def test_dashboard_active_link_only_add_permission(self):
208210
"name": self.app_link.name,
209211
"app_label": self.app_group.slug,
210212
"admin_url": self.app_link.link,
213+
"view_only": True,
211214
},
212215
)
213216

@@ -236,6 +239,7 @@ def test_dashboard_active_link_only_change_permission(self):
236239
"name": self.app_link.name,
237240
"app_label": self.app_group.slug,
238241
"admin_url": self.app_link.link,
242+
"view_only": True,
239243
},
240244
)
241245

0 commit comments

Comments
 (0)