-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add tenant and group uniqueness constraint if tenant belongs to a group #10374
Comments
@ITJamie I'm not asking to disallow global unique. I'm instead asking to make the tenant scope limited to the group only if it has one. If the tenant does not have a group, then it should work the same way it is working now. |
I have a similar issue where I'm trying to import data from our existing CMDB to our new NetBox installation. Today, I ran into the same issue wherein couple of my tenants though belong to different groups with different resources are not being added. I'm using REST APIs for perfomring the calls. I like the idea to limit the scope of the tenant into the group but also keep them unique if do not belong to any group. If it's not possible, atleast remove the name uniqueness so that I can create my custom validator to implement my business logic. |
Just a quick implementation note: Per #10361 all uniqueness constraints in NetBox v3.4+ are now being done using UniqueConstraint classes rather than |
@jeremystretch Would the new implementation help in solving this issue in any way? If the core does not implement a solution, will I be able to override the conditional logic? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
NetBox version
v3.2.2
Feature type
Change to existing functionality
Proposed functionality
Add
unique_together
forname
andgroup
on theTenant
modelUse case
I have a few end-users that have exact same name but they belong to different companies. We have modelled the companies as tenant groups on NetBox. I'd like to add two different people both named
Tim
toCompany1
andCompany2
. In future, I could have anotherTim
who does not belong to any groups.In all cases, I would like the validation by the group (if associated) just how contacts work.
We also use the
tenant
in our invoicing so adding a name likeTim 1
does not work for us as this would be reflected on the bill sent to the customer.Adding the uniqueness constraint should not break anything existing either since it was not possible to have two
Tims
in the system anyhow.Previously raised as bug #10373 but closed
Database changes
Add
unique_together
forname
andgroup
on theTenant
modelExternal dependencies
No response
The text was updated successfully, but these errors were encountered: