Skip to content

Custom validators unable to validate tag presence  #12731

@stuntguy3000

Description

@stuntguy3000

NetBox version

v3.5.1

Python version

3.10

Steps to Reproduce

  1. Set the Custom Validators setting to validate tag requirements
CUSTOM_VALIDATORS = {
        "ipam.ipaddress": [{"tags": {"required": True}}],
        "dcim.site": [{"tags": {"required": True}}],
        "dcim.region": [{"tags": {"required": True}}]
}
  1. Create a new object defined in the list above with/without tags defined.

(This error is not exclusive to those object types)

Expected Behavior

I expected NetBox to validate if that particular object has tags set.

Observed Behavior

<class 'ValueError'>

IPAddress objects need to have a primary key value before you can access their tags.

Python version: 3.10.6
NetBox version: 3.5.1

I'm not sure if I'm asking too much from the Custom Validators here, or if another method to enforce the existence of Tags is available.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions