diff --git a/netbox/extras/models/reports.py b/netbox/extras/models/reports.py index 66006c90f..bf33e20ba 100644 --- a/netbox/extras/models/reports.py +++ b/netbox/extras/models/reports.py @@ -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 return cls.full_name.split(".", maxsplit=1)[1] - module = self.get_module() + try: + module = self.get_module() + except ImportError: + return {} reports = {} ordered = getattr(module, 'report_order', []) diff --git a/netbox/extras/models/scripts.py b/netbox/extras/models/scripts.py index f830f134c..29c8085db 100644 --- a/netbox/extras/models/scripts.py +++ b/netbox/extras/models/scripts.py @@ -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 return cls.full_name.split(".", maxsplit=1)[1] - module = self.get_module() + try: + module = self.get_module() + except ImportError: + return {} scripts = {} ordered = getattr(module, 'script_order', [])