Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config revision view error when using custom validators #13809

Closed
jonatangobbato opened this issue Sep 19, 2023 · 0 comments · Fixed by #13825
Closed

Config revision view error when using custom validators #13809

jonatangobbato opened this issue Sep 19, 2023 · 0 comments · Fixed by #13825
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jonatangobbato
Copy link

jonatangobbato commented Sep 19, 2023

NetBox version

v3.6.1

Python version

3.8

Steps to Reproduce

  1. Create Custom Validator
    EX:
from extras.validators import CustomValidator

class cvReservationMAC(CustomValidator):
    def validate(self, instance):
        if instance.status == 'dhcp' and not instance.cf["MAC_Address"]:
            self.fail("DHCP Reservations must have Mac Address!", field='cf_MAC_Address')

class cvReservationDNSName(CustomValidator):
    def validate(self, instance):
        if instance.status == 'dhcp' and not instance.dns_name:
            self.fail("DHCP Reservations must have DNS Name!", field='dns_name')

CUSTOM_VALIDATORS = {
    'ipam.ipaddress': (
        cvReservationMAC(),
        cvReservationDNSName(),
    )
}
  1. Open menu "Admin >> Current Config" Click on Edit

Expected Behavior

Edit config context appears

Observed Behavior

image

@jonatangobbato jonatangobbato added the type: bug A confirmed report of unexpected behavior in the application label Sep 19, 2023
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows labels Sep 19, 2023
@arthanson arthanson self-assigned this Sep 19, 2023
@arthanson arthanson removed the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Sep 19, 2023
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants