1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-20 06:50:23 +03:00

Refactor HandlerNode to improve help path generation for custom methods

This commit is contained in:
Adolfo Gómez García 2025-02-06 01:22:01 +01:00
parent 8130afa2d5
commit d82e7dc838
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -256,9 +256,10 @@ class HandlerNode:
# Method is a Me CustomModelMethod,
# We access the __doc__ of the function inside the handler with method.name
doc = getattr(self.handler, method.name).__doc__ or ''
path = f'{self.full_path()}/{method.name}' if not method.needs_parent else f'{self.full_path()}/<uuid>/{method.name}'
custom_help.add(
HelpNode(
HelpPath(path=self.full_path() + '/' + method.name, help=doc),
HelpPath(path=path, help=doc),
[],
HelpNode.Type.CUSTOM,
)