Fixes #20498: Apply validation regex to URL custom fields #1027

Closed
opened 2026-04-05 19:55:36 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jnovinger on 10/20/2025

Fixes: #20498

The validation_regex field was not being enforced for URL type custom fields. This fix adds regex validation in two places:

  1. to_form_field() - Applies regex validator to form fields (UI validation)
  2. validate() - Applies regex check in model validation (API/programmatic)

The original issue reported UI validation only, but this fix also adds API validation for consistency with text field behavior and to ensure data integrity across all entry points.

*Originally created by @jnovinger on 10/20/2025* Fixes: #20498 The `validation_regex` field was not being enforced for URL type custom fields. This fix adds regex validation in two places: 1. `to_form_field()` - Applies regex validator to form fields (UI validation) 2. `validate()` - Applies regex check in model validation (API/programmatic) The original issue reported UI validation only, but this fix also adds API validation for consistency with text field behavior and to ensure data integrity across all entry points.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1027