diff --git a/beesgospel/forms.py b/beesgospel/forms.py index 9a47efe..2a5161f 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 self.instance.pk and not data.get("fichier") and not data.get("lien"): + if 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/beesgospel/templatetags/bees_utils.py b/beesgospel/templatetags/bees_utils.py index 8f8a348..6c58526 100644 --- a/beesgospel/templatetags/bees_utils.py +++ b/beesgospel/templatetags/bees_utils.py @@ -16,7 +16,7 @@ def icon_url(file_name): icon = "image" elif ext == ".pdf": icon = "pdf" - elif ext in [".mp3", ".m4a", ".wav"]: + elif ext in [".mp3", ".wav"]: icon = "mp3" elif ext in (".xls", ".xlsx", ".ods", ".csv"): icon = "tsv" diff --git a/templates/membres/chant_edit.html b/templates/membres/chant_edit.html index 38e559e..58a1cea 100644 --- a/templates/membres/chant_edit.html +++ b/templates/membres/chant_edit.html @@ -11,7 +11,6 @@ {% for subform in form.formset %}
- {% for fld in subform.hidden_fields %}{{ fld }}{% endfor %} {% if subform.fichier %}{{ subform.fichier.as_field_group }} {% elif subform.instance.fichier %}
Fichier: {{ subform.instance.fichier }}