From c32b681a2640277c09395979eb8467b7adf29d25 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Wed, 6 Nov 2024 17:05:06 -0800 Subject: [PATCH] 7848 OpenAPI doc generation --- netbox/core/api/schema.py | 3 +++ 1 file changed, 3 insertions(+) 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.