-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.6.5
Python version
3.10
Steps to Reproduce
- Add this snippet to your configuration.py
from extras.validators import CustomValidator
class MyValidator(CustomValidator):
def validate(self, instance):
self.fail("This error won't appear")
CUSTOM_VALIDATORS = {"core.datasource": [MyValidator]}
- Make sure that when you create Data Source from UI there is no validation error
This happens due to lack of super().clean() here:
https://github.com/netbox-community/netbox/blob/develop/netbox/core/models/data.py#L124
And, I suppose, it also causes other unpleasant side-effects because other NetBoxFeatureSet members .clean() are also not called
Expected Behavior
Validation Error happens after creation of the new Data Source after MyValidator has been added to CUSTOM_VALIDATORS
Observed Behavior
MyValidator is ignored, no error appeared.
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application