From: Yoan Le Clanche Date: Wed, 12 Nov 2025 13:41:31 +0000 (+0100) Subject: fix testimonials X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c1f519e80835b4c30281656cc0b18cf9206957de;p=teleforma.git fix testimonials --- diff --git a/teleforma/models/core.py b/teleforma/models/core.py index 0331e390..db517c6d 100755 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -1081,6 +1081,9 @@ class Conference(Displayable, WebclassMixin, ProductCodeMixin, SuggestionsMixin) self.readers.add(user) self.save() + def conf_duration(self): + return (self.date_end - self.date_begin).total_seconds() + class Meta(MetaCore): db_table = app_label + '_' + 'conference' verbose_name = _('conference') diff --git a/teleforma/templates/teleforma/conference_testimonial.html b/teleforma/templates/teleforma/conference_testimonial.html index 89fcc34d..29729624 100644 --- a/teleforma/templates/teleforma/conference_testimonial.html +++ b/teleforma/templates/teleforma/conference_testimonial.html @@ -28,12 +28,11 @@
- - + diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 659df397..26ca2a15 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -1023,8 +1023,7 @@ class ConferenceTestimonialView(PDFTemplateResponseMixin, DetailView): conference = context['conference'] testimonials = Testimonial.objects.filter( - conference=conference, user=self.request.user, seminar=None) - + conference=conference, user=self.request.user) if testimonials: testimonial = testimonials[0] context.update(get_testimonial_context(testimonial))
{% trans "Last name" %} : {{ testimonial.user.last_name|upper }}
{% trans "First name" %} : {{ testimonial.user.first_name|upper }}
{% trans "Address" %} : {{ testimonial.user.auditor.all.0.address }} {{ testimonial.user.auditor.all.0.postal_code }} {{ testimonial.user.auditor.all.0.city }}
Durée de la formation : {{ conference.duration|hours }} {% trans "hours" %}
Durée de la formation : {{ conference.conf_duration|fancy_seconds }} {% trans "hours" %}
{% trans "Object" %} : {{ conference.title }}
Type de formation : Présentiel / Webconférence
Date de la formation : {{ first_revision.date|date:'j F Y' }}