feat: add bulk images and tenant autofill

This commit is contained in:
2026-08-03 15:35:44 +02:00
parent cd542f04f7
commit d54fc646ee
16 changed files with 641 additions and 9 deletions
+2
View File
@@ -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