]> git.parisson.com Git - teleforma.git/commitdiff
fix testimonials
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 12 Nov 2025 13:41:31 +0000 (14:41 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 12 Nov 2025 13:41:31 +0000 (14:41 +0100)
teleforma/models/core.py
teleforma/templates/teleforma/conference_testimonial.html
teleforma/views/pro.py

index 0331e39004bd87576612e795ed2f5716c93dcf5f..db517c6d05cc2d95db056b5c7e5e4a0bf13c28dd 100755 (executable)
@@ -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')
index 89fcc34da73901524db065946a85f04ee16a7658..2972962415d06a031e156edba435b61e115fd2b6 100644 (file)
 </div>
 
 <div id="content">
-
    <table class="table1">
       <tr><td class="bold">{% trans "Last name" %} : </td><td>{{ testimonial.user.last_name|upper }}</td></tr>
       <tr><td class="bold">{% trans "First name" %} : </td><td>{{ testimonial.user.first_name|upper }}</td></tr>
       <tr><td class="bold">{% trans "Address" %} : </td><td>{{ testimonial.user.auditor.all.0.address }} {{ testimonial.user.auditor.all.0.postal_code }} {{ testimonial.user.auditor.all.0.city }}</td></tr>
-      <tr><td class="bold">Durée de la formation : </td><td>{{ conference.duration|hours }} {% trans "hours" %}</td></tr>
+      <tr><td class="bold">Durée de la formation : </td><td>{{ conference.conf_duration|fancy_seconds }} {% trans "hours" %}</td></tr>
       <tr><td class="bold">{% trans "Object" %} : </td><td>{{ conference.title }}</td></tr>
       <tr><td class="bold">Type de formation : </td><td>Présentiel / Webconférence</td></tr>
       <tr><td class="bold">Date de la formation : </td><td>{{ first_revision.date|date:'j F Y' }}</td></tr>
index 659df3975e049bc997dcd3597e607fd7622bcad4..26ca2a151fb0dd113ed4e9065056aeb4001511ed 100644 (file)
@@ -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))