Skip to content

Commit 2a8bec1

Browse files
arthansonjeremystretch
authored andcommitted
16867 render dashboard if model no longer available
1 parent 013139a commit 2a8bec1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

netbox/extras/dashboard/widgets.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ def clean_url_params(self):
251251
def render(self, request):
252252
app_label, model_name = self.config['model'].split('.')
253253
model = ObjectType.objects.get_by_natural_key(app_label, model_name).model_class()
254+
if not model:
255+
logger.debug(f"Dashboard Widget model_class not found: {app_label}:{model_name}")
256+
return
257+
254258
viewname = get_viewname(model, action='list')
255259

256260
# Evaluate user's permission. Note that this controls only whether the HTMX element is

0 commit comments

Comments
 (0)