mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 17:26:10 -06:00
wip
This commit is contained in:
parent
ab1a96dede
commit
b868a47ec6
@ -231,7 +231,13 @@ class NetBoxAutoSchema(AutoSchema):
|
|||||||
|
|
||||||
# If a docstring is provided, use it.
|
# If a docstring is provided, use it.
|
||||||
if self.view.__doc__:
|
if self.view.__doc__:
|
||||||
return self.view.__doc__
|
return get_doc(self.view.__class__)
|
||||||
|
|
||||||
|
# When the action method is decorated with @action, use the docstring
|
||||||
|
# of the method.
|
||||||
|
action_or_method = getattr(self.view, getattr(self.view, 'action', self.method.lower()), None)
|
||||||
|
if action_or_method and action_or_method.__doc__:
|
||||||
|
return get_doc(action_or_method)
|
||||||
|
|
||||||
# Else, generate a description from the class name.
|
# Else, generate a description from the class name.
|
||||||
description = self.view.__class__.__name__
|
description = self.view.__class__.__name__
|
||||||
|
Loading…
Reference in New Issue
Block a user