Can you make Tenants a Requirement? #5956
-
I'm using Tenants to filter multiple customer setups. But, I am forgetting to always set the Tenant on the Add New screens. Is there a way to make this a requirement when filling out all Add New forms? Also, why do I always have to populate this? When viewing an object (e.g. a Tenant), I can click on "Sites" or "Racks" on the right side - within this Tenant view. However, the Add New pages do not pre-populate the Tenant - even though I am on the tenant slug? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I use reports to flag those sort of things. If you forget to add tenants frequently, it's very likely there are other devices without tenant associated and reports can help you to find them quickly and go over them. You could create a script that does that and forces that field to be required but then you wouldn't be using NB core UI but invoking the script you created. Not sure that'd work for you. |
Beta Was this translation helpful? Give feedback.
-
You can add new permission for example for devices (dcim.add/change/delete_device) with constraint such as: Now you cannot create/edit/delete devices without the mandatory filling tenant field |
Beta Was this translation helpful? Give feedback.
-
You can use the CustomValidators capability as well. |
Beta Was this translation helpful? Give feedback.
You can add new permission for example for devices (dcim.add/change/delete_device) with constraint such as:
{"tenant__id__isnull": false}
And apply it to users or/and groups of users
Now you cannot create/edit/delete devices without the mandatory filling tenant field