[PR #5126] [MERGED] fixes #5108 - correct the runreport management command to work with JobResult model #12968

Closed
opened 2025-12-29 22:24:38 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/5126
Author: @lampwins
Created: 9/10/2020
Status: Merged
Merged: 9/14/2020
Merged by: @jeremystretch

Base: developHead: 5108-report-management-command-fix


📝 Commits (1)

  • c5e82a3 fixes #5108 - correct the runreport management command to work with JobResults model

📊 Changes

1 file changed (+30 additions, -4 deletions)

View changed files

📝 netbox/extras/management/commands/runreport.py (+30 -4)

📄 Description

Fixes: #5108

This PR fixes the runreport management command to use the JobResult.enqueue_job() pattern. One could argue we could create the JobResult instance out of band and call run_report() directly, but I feel doing it the way I have enforces the API pattern in place elsewhere. Also given the realistic longevity of this command, I feel this works well enough.


🔄 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/5126 **Author:** [@lampwins](https://github.com/lampwins) **Created:** 9/10/2020 **Status:** ✅ Merged **Merged:** 9/14/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `5108-report-management-command-fix` --- ### 📝 Commits (1) - [`c5e82a3`](https://github.com/netbox-community/netbox/commit/c5e82a389545ae5516577e452ddd9cb32fc0a185) fixes #5108 - correct the runreport management command to work with JobResults model ### 📊 Changes **1 file changed** (+30 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/management/commands/runreport.py` (+30 -4) </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 opened for approval prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. Please indicate the relevant feature request or bug report below. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ACCEPTED BUG REPORT OR FEATURE REQUEST, IT WILL BE MARKED AS INVALID AND CLOSED. --> ### Fixes: #5108 <!-- Please include a summary of the proposed changes below. --> This PR fixes the runreport management command to use the JobResult.enqueue_job() pattern. One could argue we could create the JobResult instance out of band and call `run_report()` directly, but I feel doing it the way I have enforces the API pattern in place elsewhere. Also given the realistic longevity of this command, I feel this works well enough. --- <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 22:24:38 +01:00
adam closed this issue 2025-12-29 22:24:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12968