1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #4326: Exclude Python modules without Script classes from scripts list

This commit is contained in:
Jeremy Stretch
2020-03-06 20:59:32 -05:00
parent 9a829500cd
commit f9073a2f07
2 changed files with 6 additions and 1 deletions

View File

@ -438,7 +438,8 @@ def get_scripts(use_names=False):
module_scripts = OrderedDict()
for name, cls in inspect.getmembers(module, is_script):
module_scripts[name] = cls
scripts[module_name] = module_scripts
if module_scripts:
scripts[module_name] = module_scripts
return scripts