Skip to content

Add tenant and group uniqueness constraint if tenant belongs to a group #10374

@abhi1693

Description

@abhi1693

NetBox version

v3.2.2

Feature type

Change to existing functionality

Proposed functionality

Add unique_together for name and group on the Tenant model

Use 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 to Company1 and Company2. In future, I could have another Tim 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 like Tim 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 for name and group on the Tenant model

External dependencies

No response

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions