From 190e443f5ca8ba3fd6323678566bd65bcba9d568 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 7 Nov 2025 17:24:30 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Ic=C3=B4ne=20son=20pour=20fichiers=20.m4a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beesgospel/templatetags/bees_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beesgospel/templatetags/bees_utils.py b/beesgospel/templatetags/bees_utils.py index 6c58526..8f8a348 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", ".wav"]: + elif ext in [".mp3", ".m4a", ".wav"]: icon = "mp3" elif ext in (".xls", ".xlsx", ".ods", ".csv"): icon = "tsv" From d1be12653739c8612b4db7fa1d98b7ee1bc55f21 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 7 Nov 2025 17:32:27 +0100 Subject: [PATCH 2/2] Correction forms ChantDoc --- beesgospel/forms.py | 2 +- templates/membres/chant_edit.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 %}
+ {% for fld in subform.hidden_fields %}{{ fld }}{% endfor %} {% if subform.fichier %}{{ subform.fichier.as_field_group }} {% elif subform.instance.fichier %}
Fichier: {{ subform.instance.fichier }}