Skip to content

Commit 6eaeca9

Browse files
committed
Hide exception in ObjectCountsWidget for models without a xxx_list view function
Fixes #17341
1 parent e93e9ac commit 6eaeca9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

netbox/extras/dashboard/widgets.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ def render(self, request):
183183
for model in get_models_from_content_types(self.config['models']):
184184
permission = get_permission_for_model(model, 'view')
185185
if request.user.has_perm(permission):
186-
url = reverse(get_viewname(model, 'list'))
186+
try:
187+
url = reverse(get_viewname(model, 'list'))
188+
except:
189+
url = '#'
187190
qs = model.objects.restrict(request.user, 'view')
188191
# Apply any specified filters
189192
if filters := self.config.get('filters'):

0 commit comments

Comments
 (0)