[PR #20207] [MERGED] Fixes #19896: cf minmax mustbe int #15846

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20207
Author: @Jathn
Created: 8/29/2025
Status: Merged
Merged: 9/5/2025
Merged by: @arthanson

Base: mainHead: 19896-cf-minmax-mustbe-int


📝 Commits (7)

  • 276dd6c Fixes #19896: allow decimal number boundaries for custom fields
  • 7609d29 Merge branch 'netbox-community:main' into 19896-cf-minmax-mustbe-int
  • 6cc6650 Change max_digits and decimal_places to match Integer instead of BigInteger
  • 017b173 Modify graphql to use FloatLookup instead of IntegerLookup
  • 00afc1e Merge branch 'netbox-community:main' into 19896-cf-minmax-mustbe-int
  • 3ea2939 merged 4.4.0 release migrations
  • 28be6a7 Change duplicate entry 0130 from migration history and move new changes to 0133

📊 Changes

5 files changed (+35 additions, -10 deletions)

View changed files

📝 netbox/extras/forms/bulk_edit.py (+2 -2)
📝 netbox/extras/forms/filtersets.py (+2 -2)
📝 netbox/extras/graphql/filters.py (+3 -3)
netbox/extras/migrations/0133_make_cf_minmax_decimal.py (+21 -0)
📝 netbox/extras/models/customfields.py (+7 -3)

📄 Description

Fixes #19896: Allow decimal number boundaries for custom fields

The changes made allows storing decimal values as boundary values for custom fields. This fixes the previous bug that caused values to be stored as whole numbers.

Changes made:

  • Changes customfields model to use models.DecimalField to store validation_maximum and validation_minimum
  • Changes customfields filterset to use forms.DecimalField for respective fields
  • Database migration 0130 in extras application to allow above changes

🔄 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/20207 **Author:** [@Jathn](https://github.com/Jathn) **Created:** 8/29/2025 **Status:** ✅ Merged **Merged:** 9/5/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `main` ← **Head:** `19896-cf-minmax-mustbe-int` --- ### 📝 Commits (7) - [`276dd6c`](https://github.com/netbox-community/netbox/commit/276dd6c94e367b6d5a8154f807419d00144edef9) Fixes #19896: allow decimal number boundaries for custom fields - [`7609d29`](https://github.com/netbox-community/netbox/commit/7609d290ebe86e3aa35210b7cf22fe0535675cd0) Merge branch 'netbox-community:main' into 19896-cf-minmax-mustbe-int - [`6cc6650`](https://github.com/netbox-community/netbox/commit/6cc6650b32be163f70dec22dc869040eadbeac1b) Change max_digits and decimal_places to match Integer instead of BigInteger - [`017b173`](https://github.com/netbox-community/netbox/commit/017b17376178efb9fb81d03b27e19ae44505ef09) Modify graphql to use FloatLookup instead of IntegerLookup - [`00afc1e`](https://github.com/netbox-community/netbox/commit/00afc1e7cbd0522036d6fea8683f12ea5b78ea40) Merge branch 'netbox-community:main' into 19896-cf-minmax-mustbe-int - [`3ea2939`](https://github.com/netbox-community/netbox/commit/3ea2939ebcf717a19ba99eb8ae9456cad6e4f50a) merged 4.4.0 release migrations - [`28be6a7`](https://github.com/netbox-community/netbox/commit/28be6a726d738af0fbcba78baa58cfdce220f397) Change duplicate entry 0130 from migration history and move new changes to 0133 ### 📊 Changes **5 files changed** (+35 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/forms/bulk_edit.py` (+2 -2) 📝 `netbox/extras/forms/filtersets.py` (+2 -2) 📝 `netbox/extras/graphql/filters.py` (+3 -3) ➕ `netbox/extras/migrations/0133_make_cf_minmax_decimal.py` (+21 -0) 📝 `netbox/extras/models/customfields.py` (+7 -3) </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 #19896: Allow decimal number boundaries for custom fields <!-- Please include a summary of the proposed changes below. --> The changes made allows storing decimal values as boundary values for custom fields. This fixes the previous bug that caused values to be stored as whole numbers. Changes made: - Changes customfields model to use models.DecimalField to store validation_maximum and validation_minimum - Changes customfields filterset to use forms.DecimalField for respective fields - Database migration 0130 in extras application to allow above changes --- <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:24:23 +01:00
adam closed this issue 2025-12-30 00:24:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15846