mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
16867 render dashboard if model no longer available
This commit is contained in:
parent
013139aa20
commit
2a8bec1cbf
@ -251,6 +251,10 @@ class ObjectListWidget(DashboardWidget):
|
|||||||
def render(self, request):
|
def render(self, request):
|
||||||
app_label, model_name = self.config['model'].split('.')
|
app_label, model_name = self.config['model'].split('.')
|
||||||
model = ObjectType.objects.get_by_natural_key(app_label, model_name).model_class()
|
model = ObjectType.objects.get_by_natural_key(app_label, model_name).model_class()
|
||||||
|
if not model:
|
||||||
|
logger.debug(f"Dashboard Widget model_class not found: {app_label}:{model_name}")
|
||||||
|
return
|
||||||
|
|
||||||
viewname = get_viewname(model, action='list')
|
viewname = get_viewname(model, action='list')
|
||||||
|
|
||||||
# Evaluate user's permission. Note that this controls only whether the HTMX element is
|
# Evaluate user's permission. Note that this controls only whether the HTMX element is
|
||||||
|
Loading…
Reference in New Issue
Block a user