From e4b4d773ff645151b18bfcf2e8ecbc275809a59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr> Date: Wed, 17 Jul 2019 13:47:20 +0200 Subject: [PATCH] make domain optional in ProteinDomainComplex form fix #77 --- ippisite/ippidb/forms.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ippisite/ippidb/forms.py b/ippisite/ippidb/forms.py index db8999ac..44d7f4df 100644 --- a/ippisite/ippidb/forms.py +++ b/ippisite/ippidb/forms.py @@ -252,9 +252,9 @@ class ComplexCompositionForm(forms.Form): ) domain = forms.ModelChoiceField( queryset=Domain.objects.none(), - required=True, + required=False, widget=forms.Select(attrs={'class': 'form-control'}), - empty_label=None, + empty_label="Unidentified", ) ppc_copy_nb = forms.IntegerField( label="Number of copies of the protein in the complex", @@ -289,7 +289,6 @@ class ComplexCompositionForm(forms.Form): self.cleaned_data.get("ppp_copy_nb_per_p", None) is None: self.add_error("ppp_copy_nb_per_p", _("This field is required")) - class ComplexCompositionBaseFormSet(forms.BaseFormSet): def full_clean(self): """ -- GitLab