`Record` and `NameServer` are not validated by custom validators
Closed this issue · 0 comments
peteeckel commented
Versions
NetBox Version: 3.7.6
NetBox DNS Version: 0.22.8
Python Version: 3.11.5
Describe the bug
For Record
and Nameserver
objects, custom validators are not executed.
To Reproduce
Steps to reproduce the behavior:
- Define a custom validator for testing, e.g.
#
# /opt/netbox/netbox/deny.py
#
from extras.validators import CustomValidator
class Deny(CustomValidator):
def validate(self, instance):
self.fail("I don't feel like this today, sorry")
- Configure NetBox to use the validator to validate one of the object types mentioned above
CUSTOM_VALIDATORS = {
"netbox_dns.record": [
"validators.deny.Deny",
],
}
- Edit and save an arbitrary record
Expected result
Saving the record is denied with the error message "I don't feel like this today, sorry"
Actual result
The record is saved