Skip to content

Commit

Permalink
Hide exception in ObjectCountsWidget for models without a xxx_list
Browse files Browse the repository at this point in the history
…view function

Fixes netbox-community#17341
  • Loading branch information
candlerb committed Sep 3, 2024
1 parent e93e9ac commit 70baeb9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion netbox/extras/dashboard/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ def render(self, request):
for model in get_models_from_content_types(self.config['models']):
permission = get_permission_for_model(model, 'view')
if request.user.has_perm(permission):
url = reverse(get_viewname(model, 'list'))
try:
url = reverse(get_viewname(model, 'list'))
except Exception:
url = '#'
qs = model.objects.restrict(request.user, 'view')
# Apply any specified filters
if filters := self.config.get('filters'):
Expand Down

0 comments on commit 70baeb9

Please sign in to comment.