feat: add bulk images and tenant autofill
This commit is contained in:
1 parent
cd542f04f7
commit
d54fc646ee
16 files changed
+641
-9
No files matched your search
@@ -7,6 +7,7 @@ from django.forms.models import BaseModelForm
|
||||
from tenancy.models import Tenant
|
||||
|
||||
from .runtime import tenant_required
|
||||
from .tenant_autofill import apply_tenant_autofill
|
||||
|
||||
VALIDATION_MESSAGE = "Für dieses Objekt muss ein Mandant angegeben werden."
|
||||
|
||||
@@ -55,6 +56,7 @@ def _install_form_validation():
|
||||
model = getattr(form._meta, "model", None)
|
||||
if tenant_required() and model and model_supports_tenant(model) and "tenant" in form.fields:
|
||||
form.fields["tenant"].required = True
|
||||
apply_tenant_autofill(form)
|
||||
|
||||
BaseModelForm.__init__ = tenant_aware_init
|
||||
BaseModelForm._netbox_utilities_tenant_validation = True
|
||||
|
||||
Reference in new issue
Block a user