Commit dbc15118 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Fix display switchs order

parent 006e7d1d
......@@ -120,7 +120,7 @@ class EditOptionalTopologieForm(ModelForm):
self.fields['vlan_decision_nok'].label = _("VLAN for machines rejected"
" by RADIUS")
self.initial['automatic_provision_switchs'] = Switch.objects.filter(automatic_provision=True)
self.initial['automatic_provision_switchs'] = Switch.objects.filter(automatic_provision=True).order_by('interface__domain__name')
def save(self, commit=True):
instance = super().save(commit)
......
......@@ -260,7 +260,7 @@ class OptionalTopologie(AclMixin, PreferencesModel):
def provisioned_switchs(self):
"""Liste des switches provisionnés"""
from topologie.models import Switch
return Switch.objects.filter(automatic_provision=True)
return Switch.objects.filter(automatic_provision=True).order_by('interface__domain__name')
@cached_property
def switchs_management_interface(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment