From fff3193f6512e3be8d6edfdaf854f8c4c92813d9 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 28 May 2017 19:22:45 +0200 Subject: [PATCH] FIx bug creation machine --- machines/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/machines/forms.py b/machines/forms.py index ab141b49..c4faac97 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -55,7 +55,8 @@ 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" - self.fields['machine'].queryset = Machine.objects.all().select_related('user') + if "machine" in self.fields: + self.fields['machine'].queryset = Machine.objects.all().select_related('user') def clean(self): data = super(EditInterfaceForm, self).clean()