From 2d14e1f1b59feee12a7c0458f291103bb2a2385d Mon Sep 17 00:00:00 2001 From: chirac Date: Mon, 2 Oct 2017 17:36:13 +0200 Subject: [PATCH] Bug fix : n'affiche que les ip libres avec les droits infra --- machines/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/machines/forms.py b/machines/forms.py index cd4ac87d..0de53c49 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -57,6 +57,9 @@ class EditInterfaceForm(ModelForm): self.fields['mac_address'].label = 'Adresse mac' self.fields['type'].label = 'Type de machine' self.fields['type'].empty_label = "Séléctionner un type de machine" + if "ipv4" in self.fields: + self.fields['ipv4'].empty_label = "Assignation automatique de l'ipv4" + self.fields['ipv4'].queryset = IpList.objects.filter(interface__isnull=True) if "machine" in self.fields: self.fields['machine'].queryset = Machine.objects.all().select_related('user')