CUSTOM_VALIDATORS field regex not applying #7653

Closed
opened 2025-12-29 20:26:29 +01:00 by adam · 1 comment
Owner

Originally created by @damo2929 on GitHub (Feb 16, 2023).

NetBox version

V3.4.3

Python version

3.10

Steps to Reproduce

create a custom validator

CUSTOM_VALIDATORS = {
    "tenancy.tenant": [
       {
          "slug": {
             "regex": "^[a-z_]*"
          }
       }
    ]
}

then create a tenent with a space in the default - is added but this should trip on the regex to replace this with _ for ansible

Expected Behavior

this should have tripped a validation error on the field until the only the charactors in the regex are present.

Observed Behavior

creation of record without Tripping.

Originally created by @damo2929 on GitHub (Feb 16, 2023). ### NetBox version V3.4.3 ### Python version 3.10 ### Steps to Reproduce create a custom validator ```` CUSTOM_VALIDATORS = { "tenancy.tenant": [ { "slug": { "regex": "^[a-z_]*" } } ] } ```` then create a tenent with a space in the default - is added but this should trip on the regex to replace this with _ for ansible ### Expected Behavior this should have tripped a validation error on the field until the only the charactors in the regex are present. ### Observed Behavior creation of record without Tripping.
adam closed this issue 2025-12-29 20:26:29 +01:00
Author
Owner

@damo2929 commented on GitHub (Feb 16, 2023):

resolved myself but need better regex use documentation.

@damo2929 commented on GitHub (Feb 16, 2023): resolved myself but need better regex use documentation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7653