peteeckel/netbox-plugin-dns

`Record` and `NameServer` are not validated by custom validators

Closed this issue · 0 comments

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:

  1. 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")
  1. Configure NetBox to use the validator to validate one of the object types mentioned above
CUSTOM_VALIDATORS = {
    "netbox_dns.record": [
        "validators.deny.Deny",
    ],
}
  1. 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