From 65b7a7dba037729e0a75c1b643ec577e68830042 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Thu, 5 Jan 2017 23:48:45 +0100 Subject: [PATCH] Pas de cname sur les mx --- machines/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/machines/forms.py b/machines/forms.py index 99c2c570..822c5faa 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -141,7 +141,11 @@ class MxForm(ModelForm): class Meta: model = Mx fields = ['zone', 'priority', 'name'] - + + def __init__(self, *args, **kwargs): + super(MxForm, self).__init__(*args, **kwargs) + self.fields['name'].queryset = Domain.objects.exclude(interface_parent=None) + class DelMxForm(ModelForm): mx = forms.ModelMultipleChoiceField(queryset=Mx.objects.all(), label="MX actuels", widget=forms.CheckboxSelectMultiple)