feat(account): Use a setting to register VLANs automatically on registration

This commit is contained in:
Tom Hubrecht 2025-02-22 18:59:03 +01:00
parent 07192b14f7
commit 5e356f7302
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
2 changed files with 4 additions and 0 deletions

View file

@ -242,6 +242,7 @@ DGSI_SUPERUSER_GROUP = credentials.get("SUPERUSER_GROUP", "dgnum_admins@sso.dgnu
VLAN_ID_MAX = 4094
VLAN_ID_MIN = (VLAN_ID_MAX - 850) + 1
VLAN_AUTOCONNECT = credentials.get("VLAN_AUTOCONNECT", False)
###

View file

@ -184,6 +184,9 @@ class CreateSelfAccountView(AccessMixin, SuccessMessageMixin, FormView):
headers={"Reply-To": "contact@dgnum.eu"},
).send()
if settings.VLAN_AUTOCONNECT:
u.register_unique_vlan()
return super().form_valid(form)