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

Allow reports to be nested in submodules

This commit is contained in:
kkthxbye-code
2022-09-14 19:57:37 +02:00
parent f489ffa043
commit 356ff457be
5 changed files with 27 additions and 19 deletions

View File

@@ -534,9 +534,10 @@ class ReportListView(ContentTypePermissionRequiredMixin, View):
}
ret = []
for module, report_list in reports:
for module, report_list in reports.items():
module_reports = []
for report in report_list:
for report in report_list.values():
report.result = results.get(report.full_name, None)
module_reports.append(report)
ret.append((module, module_reports))
@@ -613,7 +614,7 @@ class ReportResultView(ContentTypePermissionRequiredMixin, View):
result = get_object_or_404(JobResult.objects.all(), pk=job_result_pk, obj_type=report_content_type)
# Retrieve the Report and attach the JobResult to it
module, report_name = result.name.split('.')
module, report_name = result.name.split('.', maxsplit=1)
report = get_report(module, report_name)
report.result = result