[PR #13667] [MERGED] Fixes #13666: Fix behavior for reports without test methods #14233

Closed
opened 2025-12-29 23:23:19 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13667
Author: @JCWasmx86
Created: 9/3/2023
Status: Merged
Merged: 9/26/2023
Merged by: @jeremystretch

Base: developHead: develop


📝 Commits (1)

  • 849236d Fixes #13666: Fix behavior for reports without test methods

📊 Changes

3 files changed (+13 additions, -5 deletions)

View changed files

📝 netbox/extras/reports.py (+0 -2)
📝 netbox/templates/extras/report.html (+5 -1)
📝 netbox/templates/extras/report_list.html (+8 -2)

📄 Description

Fixes: #13666

If you upload a report file without any test methods, the entire GUI for the reports page fails. This fixes the error by splitting up the report_modules into valid and empty ones. The valid report_modules are rendered as before, the empty ones are listed with the possibility to delete them. (Before you had to drop into the CLI to delete them)

The list of reports without test methods are at the top of the page to increase the visibility of them, but you could consider moving them into the normal list of reports, but show an error/warning there - similar to e.g. "Failed to load foo.py"

Additionally there is a second commit (But can be either dropped/moved to new PR as it changes the scope of the issue a little bit). It fixes the API by filtering out those reports

Note: I wasn't able to run black, as black --config pyproject.toml netbox/ wants to reformat everything, but pycodestyle --ignore=W504,E501 netbox/ shows no warnings)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/13667 **Author:** [@JCWasmx86](https://github.com/JCWasmx86) **Created:** 9/3/2023 **Status:** ✅ Merged **Merged:** 9/26/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (1) - [`849236d`](https://github.com/netbox-community/netbox/commit/849236dc4ef04e13ec430338c489c4210469b31f) Fixes #13666: Fix behavior for reports without test methods ### 📊 Changes **3 files changed** (+13 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/reports.py` (+0 -2) 📝 `netbox/templates/extras/report.html` (+5 -1) 📝 `netbox/templates/extras/report_list.html` (+8 -2) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #13666 <!-- Please include a summary of the proposed changes below. --> If you upload a report file without any test methods, the entire GUI for the reports page fails. This fixes the error by splitting up the `report_modules` into valid and empty ones. The valid `report_module`s are rendered as before, the empty ones are listed with the possibility to delete them. (Before you had to drop into the CLI to delete them) The list of reports without test methods are at the top of the page to increase the visibility of them, but you could consider moving them into the normal list of reports, but show an error/warning there - similar to e.g. "Failed to load foo.py" Additionally there is a second commit (But can be either dropped/moved to new PR as it changes the scope of the issue a little bit). It fixes the API by filtering out those reports *Note: I wasn't able to run black, as `black --config pyproject.toml netbox/` wants to reformat everything, but `pycodestyle --ignore=W504,E501 netbox/` shows no warnings)* --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:23:19 +01:00
adam closed this issue 2025-12-29 23:23:19 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14233