[PR #17847] [MERGED] Fixes #17685 : Fix job field validation #15212

Closed
opened 2025-12-30 00:20:38 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17847
Author: @alehaa
Created: 10/23/2024
Status: Merged
Merged: 10/28/2024
Merged by: @jeremystretch

Base: developHead: 17685-job-clean


📝 Commits (1)

📊 Changes

2 files changed (+12 additions, -10 deletions)

View changed files

📝 netbox/core/models/jobs.py (+4 -2)
📝 netbox/netbox/tests/test_jobs.py (+8 -8)

📄 Description

Fixes: #17685

Previously, fields in the Job model were not validated when the job was created. Now full_clean() is called before saving the job to ensure valid data. In addition, test cases have been updated because using a Job as instance when creating a job would not pass validation.


🔄 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/17847 **Author:** [@alehaa](https://github.com/alehaa) **Created:** 10/23/2024 **Status:** ✅ Merged **Merged:** 10/28/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `17685-job-clean` --- ### 📝 Commits (1) - [`c34a0e2`](https://github.com/netbox-community/netbox/commit/c34a0e27208ccd682ccebc75198415e533ffc36d) Fix job field validation ### 📊 Changes **2 files changed** (+12 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/models/jobs.py` (+4 -2) 📝 `netbox/netbox/tests/test_jobs.py` (+8 -8) </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: #17685 <!-- Please include a summary of the proposed changes below. --> Previously, fields in the Job model were not validated when the job was created. Now `full_clean()` is called before saving the job to ensure valid data. In addition, test cases have been updated because using a `Job` as instance when creating a job would not pass validation. --- <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-30 00:20:38 +01:00
adam closed this issue 2025-12-30 00:20:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15212