From 1048841f41e8883b128844bf8322c9eeb4e26e81 Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Wed, 12 Nov 2025 13:50:20 +0100 Subject: [PATCH] Fix issue with testimonial --- .../commands/teleforma-revisions-from-bbb.py | 6 +-- .../templates/teleforma/testimonials.html | 39 ++++++++++--------- teleforma/views/pro.py | 10 ++--- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/teleforma/management/commands/teleforma-revisions-from-bbb.py b/teleforma/management/commands/teleforma-revisions-from-bbb.py index 6271a8fe..a0ce3ec8 100644 --- a/teleforma/management/commands/teleforma-revisions-from-bbb.py +++ b/teleforma/management/commands/teleforma-revisions-from-bbb.py @@ -119,8 +119,8 @@ class Command(BaseCommand): required_duration = (conf.date_end - conf.date_begin).total_seconds() * 0.9 - # print("Required duration: %d seconds" % required_duration) - # print("Total spent: %d seconds" % total_spent.total_seconds()) + print("Required duration: %d seconds" % required_duration) + print("Total spent: %d seconds" % total_spent.total_seconds()) if total_spent.total_seconds() >= required_duration: # Chercher une attestation existante if seminar: @@ -135,7 +135,7 @@ class Command(BaseCommand): user=user, seminar=None ).first() - # print("Existing testimonial: %s" % existing_testimonial) + print("Existing testimonial: %s" % existing_testimonial) if not existing_testimonial: print("Creating testimonial for %s" % conf.title + " for user " + user.username) diff --git a/teleforma/templates/teleforma/testimonials.html b/teleforma/templates/teleforma/testimonials.html index 1b1fe161..cee9eea2 100644 --- a/teleforma/templates/teleforma/testimonials.html +++ b/teleforma/templates/teleforma/testimonials.html @@ -58,32 +58,33 @@ - {% if testimonial.seminar %} + {% if testimonial.conference %} - - - - - - {% if show_fifpl %} - + - + - {% endif %} - {% elif testimonial.conference %} + {% if show_fifpl %} + + + + + {% endif %} + {% elif testimonial.seminar %} - + - + - {% if show_fifpl %} - - - - - {% endif %} + {% if show_fifpl %} + + + + + {% endif %} + + {% endif %} diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 66672157..659df397 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -929,15 +929,15 @@ class TestimonialListView(ListView): user = self.request.user testimonials = Testimonial.objects.filter(user=user) for testimonial in testimonials: - if testimonial.seminar: + if testimonial.conference: + # Attestation de conférence (webconf sans séminaire associé) + # Pour les conférences, pas de validation nécessaire, juste vérifier que l'attestation existe + t.append(testimonial) + elif testimonial.seminar: # Attestation de séminaire seminar = testimonial.seminar if seminar_validated(user, seminar) and (get_seminar_delta(user, seminar) >= 0 or testimonial.date_added <= REVISION_DATE_FILTER): t.append(testimonial) - elif testimonial.conference: - # Attestation de conférence (webconf sans séminaire associé) - # Pour les conférences, pas de validation nécessaire, juste vérifier que l'attestation existe - t.append(testimonial) return t def get_context_data(self, **kwargs): -- 2.39.5
{% trans "Training testimonial" %}{% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}
{% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %})Attestation de formation {% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}
{% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %}){% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}
{% trans "Training testimonial" %} {% trans "Training testimonial" %} {% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}
{% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %}){% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}
{% trans "Payback testimonial" %} ({% trans "only to have support of the training costs" %}){% trans "validated on" %} {% if testimonial.date_modified %}{{ testimonial.date_modified|date:'j F Y' }}{% else %}{{ testimonial.date_added|date:'j F Y' }}{% endif %}