diff --git a/netbox/core/api/schema.py b/netbox/core/api/schema.py index 1ac822b8c..039218d00 100644 --- a/netbox/core/api/schema.py +++ b/netbox/core/api/schema.py @@ -254,6 +254,9 @@ class NetBoxAutoSchema(AutoSchema): """ Generate a docstring for the method. It also takes into account whether the method is for list or detail. """ + if not hasattr(self.view, 'queryset'): + return None + model_name = self.view.queryset.model._meta.verbose_name # Determine if the method is for list or detail.