diff --git a/beesgospel/forms.py b/beesgospel/forms.py index 2a5161f..9a47efe 100644 --- a/beesgospel/forms.py +++ b/beesgospel/forms.py @@ -69,7 +69,7 @@ class ChantDocForm(BootstrapMixin, forms.ModelForm): def clean(self): data = super().clean() - if not data.get("fichier") and not data.get("lien"): + if not self.instance.pk and not data.get("fichier") and not data.get("lien"): raise forms.ValidationError("Vous devez indiquer un fichier ou un lien") elif data.get("fichier") and data.get("lien"): raise forms.ValidationError("Vous ne pouvez pas indiquer à la fois un fichier et un lien") diff --git a/templates/membres/chant_edit.html b/templates/membres/chant_edit.html index 58a1cea..38e559e 100644 --- a/templates/membres/chant_edit.html +++ b/templates/membres/chant_edit.html @@ -11,6 +11,7 @@ {% for subform in form.formset %}