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

Unique validation rule flags if unchanged when editing/saving #86

Closed
DistantVoyager opened this issue Aug 16, 2023 · 0 comments · Fixed by #87
Closed

Unique validation rule flags if unchanged when editing/saving #86

DistantVoyager opened this issue Aug 16, 2023 · 0 comments · Fixed by #87
Assignees
Labels
bug Something isn't working

Comments

@DistantVoyager
Copy link
Contributor

DistantVoyager commented Aug 16, 2023

Environment

  • Python version: 3.8
  • Nautobot version: 1.6.1b1
  • nautobot-data-validation-engine version: 2.1.0

Expected Behavior

With a unique validation rule enabled, I can successfully edit an object while not modifying the unique validated field.

Observed Behavior

Unable to edit due to the unique validation rule being flagged for the validated field. Field value is still unique to that object, but when editing it's somehow being prevented from staying the same.

Steps to Reproduce

  1. Create a new unique validation rule such as for dcim | device serial field with a max value of 1
    image

  2. Create an object of the same content type as the unique rule, such as a new device. Enter a unique value in validated field, such as 123 for serial
    image

  3. Then, edit that object by modifying a field other than the unique validated one (leave that field value the same). For example, add a note to the device and then try updating/saving it.

  4. A validation error is returned for the unique validated field, despite not changing it. For example, when just trying to add a note to the device:
    image

@DistantVoyager DistantVoyager added the bug Something isn't working label Aug 16, 2023
@DistantVoyager DistantVoyager linked a pull request Aug 16, 2023 that will close this issue
@DistantVoyager DistantVoyager self-assigned this Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant