[PR #19051] [MERGED] Fixes #19041: Call super().clean() in FrontPortCreateForm #15511

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19051
Author: @pheus
Created: 4/1/2025
Status: Merged
Merged: 4/2/2025
Merged by: @jeremystretch

Base: mainHead: bugfix/19041-front-port-with-label


📝 Commits (3)

  • e74d487 fix(forms): Call super().clean() in clean methods
  • 9564f64 test(forms): Add tests for front port form validation
  • e0c12f1 Omit errant print statement

📊 Changes

2 files changed (+54 additions, -1 deletions)

View changed files

📝 netbox/dcim/forms/object_create.py (+2 -0)
📝 netbox/dcim/tests/test_forms.py (+52 -1)

📄 Description

Fixes: #19041

This PR addresses an issue with form validation in FrontPortCreateForm and FrontPortTemplateCreateForm.
It adds a call to super().clean() in their clean methods to ensure that base class validation logic is executed properly before applying custom validation logic.

Additionally, this PR introduces unit tests to validate FrontPortCreateForm behavior.
The tests cover scenarios for matching and mismatched name-label pairs to ensure proper validation logic is enforced.


🔄 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/19051 **Author:** [@pheus](https://github.com/pheus) **Created:** 4/1/2025 **Status:** ✅ Merged **Merged:** 4/2/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `bugfix/19041-front-port-with-label` --- ### 📝 Commits (3) - [`e74d487`](https://github.com/netbox-community/netbox/commit/e74d48722b55855888ee13720fdec800d24da0ac) fix(forms): Call super().clean() in clean methods - [`9564f64`](https://github.com/netbox-community/netbox/commit/9564f64b6210109a1a86a55986b3acd2da72cea5) test(forms): Add tests for front port form validation - [`e0c12f1`](https://github.com/netbox-community/netbox/commit/e0c12f1984a2777b6ddf094e29dd1ab0a592326c) Omit errant print statement ### 📊 Changes **2 files changed** (+54 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms/object_create.py` (+2 -0) 📝 `netbox/dcim/tests/test_forms.py` (+52 -1) </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: #19041 This PR addresses an issue with form validation in `FrontPortCreateForm` and `FrontPortTemplateCreateForm`. It adds a call to `super().clean()` in their `clean` methods to ensure that base class validation logic is executed properly before applying custom validation logic. Additionally, this PR introduces unit tests to validate `FrontPortCreateForm` behavior. The tests cover scenarios for matching and mismatched name-label pairs to ensure proper validation logic is enforced. --- <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:22:24 +01:00
adam closed this issue 2025-12-30 00:22:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15511