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

Tenant is not unique by associated groups #10373

Closed
abhi1693 opened this issue Sep 15, 2022 · 4 comments
Closed

Tenant is not unique by associated groups #10373

abhi1693 opened this issue Sep 15, 2022 · 4 comments

Comments

@abhi1693
Copy link
Member

NetBox version

v3.3.2

Python version

3.10

Steps to Reproduce

  1. Create a tenant with the following info
name = Abhimanyu
slug = abhimanyu
  1. Create a tenant group with the following info
name = Customers
slug = customers
  1. Create a new tenant with the following info
name = Abhimanyu
slug = abhimanyu
group = Customers

Expected Behavior

If a tenant belongs to a different group, then the uniqueness validation should be applied within the scope of the group. It is very well possible to have two or more people with the exact same name

Observed Behavior

Tenant name and slug are validated globally for uniqueness

@abhi1693 abhi1693 added the type: bug A confirmed report of unexpected behavior in the application label Sep 15, 2022
@jeremystretch
Copy link
Member

Tenant name and slug are validated globally for uniqueness

This is the intended behavior; there is nothing in the documentation to suggest that tenant names are unique per group (unless I've missed something).

You're welcome to submit a feature request proposing this change, however there are implications of relaxing the uniqueness constraint that need to be discussed. For instance, it would no longer be sufficient to reference a tenant by name only e.g. during CSV import of objects; the user would be required to specify both the name and group in order to adequately identify the a tenant.

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2022
@jeremystretch jeremystretch removed the type: bug A confirmed report of unexpected behavior in the application label Sep 15, 2022
@abhi1693
Copy link
Member Author

@jeremystretch The exact same functionality works for Contacts. I can have two users with the same name in different groups.

image

however there are implications of relaxing the uniqueness

It's not relaxing the uniqueness, it's about adding it which is missing.

The reason for opening this as a bug was I felt it was an oversight and probably got missed. Otherwise, how would you add two people with the same names to the system even though they belong to different companies? It's not possible with the current code but the same works when creating a contact.

@jeremystretch
Copy link
Member

The exact same functionality works for Contacts.

Yes, and that's how contacts are intended to work. Tenants are not.

It's not relaxing the uniqueness, it's about adding it which is missing.

Your proposal is to relax the uniqueness constraint on Tenant's name field from being globally unique to being unique only per group.

@ITJamie
Copy link
Contributor

ITJamie commented Sep 15, 2022

100% for keeping tenant object being unique globally. if this is adjusted to unique per group i hope there is a config option to keep the current default

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants