[PR #20549] [MERGED] Fixes #19302: Fix uniqueness validation in REST API for nullable fields #15961

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20549
Author: @jeremystretch
Created: 10/9/2025
Status: Merged
Merged: 10/14/2025
Merged by: @arthanson

Base: mainHead: 19302-api-null-fields-required


📝 Commits (2)

  • 501e530 Fixes #19302: Fix uniqueness validation in REST API for nullable fields
  • 9d3b13c Pin djangorestframework to v3.16.1

📊 Changes

3 files changed (+53 additions, -1 deletions)

View changed files

📝 base_requirements.txt (+2 -1)
netbox/netbox/monkey.py (+39 -0)
📝 netbox/netbox/settings.py (+12 -0)

📄 Description

Fixes: #19302

Monkey-patch DRF's get_unique_validators() function to ignore UniqueConstraints with a condition which references a field other than the base field.


🔄 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/20549 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 10/9/2025 **Status:** ✅ Merged **Merged:** 10/14/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `main` ← **Head:** `19302-api-null-fields-required` --- ### 📝 Commits (2) - [`501e530`](https://github.com/netbox-community/netbox/commit/501e5306eeee96e4a002d3b0b4c0b2976e14c305) Fixes #19302: Fix uniqueness validation in REST API for nullable fields - [`9d3b13c`](https://github.com/netbox-community/netbox/commit/9d3b13ce392c7d6961290ce67388f2128f55aee9) Pin djangorestframework to v3.16.1 ### 📊 Changes **3 files changed** (+53 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `base_requirements.txt` (+2 -1) ➕ `netbox/netbox/monkey.py` (+39 -0) 📝 `netbox/netbox/settings.py` (+12 -0) </details> ### 📄 Description ### Fixes: #19302 Monkey-patch DRF's `get_unique_validators()` function to ignore UniqueConstraints with a condition which references a field other than the base field. --- <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:25:02 +01:00
adam closed this issue 2025-12-30 00:25:02 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15961