mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* start() and terminate() methods on Job should call save() * Fix display of associated jobs * Introduce get_latest_jobs() method on JobsMixin * Update messaging when no reports/scripts exist * Catch ImportErrors when rendering report/script lists * Fix loading of nested modules * Fix URLs for nested scripts/reports
This commit is contained in:
@@ -44,6 +44,9 @@ class ReportModule(PythonModuleMixin, JobsMixin, ManagedFile):
|
||||
def get_absolute_url(self):
|
||||
return reverse('extras:report_list')
|
||||
|
||||
def __str__(self):
|
||||
return self.python_name
|
||||
|
||||
@cached_property
|
||||
def reports(self):
|
||||
|
||||
@@ -51,7 +54,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', [])
|
||||
|
||||
|
Reference in New Issue
Block a user