mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-27 01:36:11 -06:00
Catch ImportErrors when rendering report/script lists
This commit is contained in:
parent
22aaa7d097
commit
f4fe7a1f9e
@ -51,7 +51,10 @@ class ReportModule(PythonModuleMixin, JobsMixin, ManagedFile):
|
|||||||
# For child objects in submodules use the full import path w/o the root module as the name
|
# For child objects in submodules use the full import path w/o the root module as the name
|
||||||
return cls.full_name.split(".", maxsplit=1)[1]
|
return cls.full_name.split(".", maxsplit=1)[1]
|
||||||
|
|
||||||
|
try:
|
||||||
module = self.get_module()
|
module = self.get_module()
|
||||||
|
except ImportError:
|
||||||
|
return {}
|
||||||
reports = {}
|
reports = {}
|
||||||
ordered = getattr(module, 'report_order', [])
|
ordered = getattr(module, 'report_order', [])
|
||||||
|
|
||||||
|
@ -51,7 +51,10 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile):
|
|||||||
# For child objects in submodules use the full import path w/o the root module as the name
|
# For child objects in submodules use the full import path w/o the root module as the name
|
||||||
return cls.full_name.split(".", maxsplit=1)[1]
|
return cls.full_name.split(".", maxsplit=1)[1]
|
||||||
|
|
||||||
|
try:
|
||||||
module = self.get_module()
|
module = self.get_module()
|
||||||
|
except ImportError:
|
||||||
|
return {}
|
||||||
scripts = {}
|
scripts = {}
|
||||||
ordered = getattr(module, 'script_order', [])
|
ordered = getattr(module, 'script_order', [])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user