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

Multiple ConfigContext can be created with the same name #431

Closed
glennmatthews opened this issue May 11, 2021 · 0 comments · Fixed by #597
Closed

Multiple ConfigContext can be created with the same name #431

glennmatthews opened this issue May 11, 2021 · 0 comments · Fixed by #597
Assignees
Labels
type: bug Something isn't working as expected

Comments

@glennmatthews
Copy link
Contributor

Environment

  • Python version: any
  • Nautobot version: 1.0.1

Steps to Reproduce

  1. Create a ConfigContext.
  2. Create a second config context with the same name string.

Expected Behavior

Creation of the second same-named ConfigContext should fail or be blocked by the UI due to the duplicate name. This is the behavior shown in NetBox 2.10.x.

Observed Behavior

Multiple same-named config contexts can coexist. This is problematic because, in the case of multiple contexts having the same weight, ties are broken based on the context name.

This appears to be another case where a unique_together constraint is not working as one might expect due to NULL!=NULL behavior of the database, as ConfigContext defines unique_together = [["name", "owner_content_type", "owner_object_id"]] and in common usage owner_content_type and owner_object_id will be NULL values.

@glennmatthews glennmatthews added the type: bug Something isn't working as expected label May 11, 2021
@glennmatthews glennmatthews self-assigned this Jun 21, 2021
glennmatthews added a commit that referenced this issue Jun 29, 2021
…es (#597)

* Disallow non-unique names for unowned ConfigContext and ExportTemplates. Fixes #431

* Address code review comments
glennmatthews added a commit that referenced this issue Jun 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant