]> git.parisson.com Git - teleforma.git/commitdiff
fix testimonial date : https://trackers.pilotsystems.net/probarreau/0283
authorYoan Le Clanche <yoan@ellington.pilotsystems.net>
Wed, 14 Mar 2018 13:24:37 +0000 (14:24 +0100)
committerYoan Le Clanche <yoan@ellington.pilotsystems.net>
Wed, 14 Mar 2018 13:24:37 +0000 (14:24 +0100)
teleforma/views/pro.py

index eed22d21b0209fa4c9fbb81a807af98151e0c8f7..91e9005ed2d0b76e6b4b73c31a6ae3967e60bd6b 100644 (file)
@@ -254,6 +254,10 @@ class SeminarView(SeminarAccessMixin, DetailView):
             testimonials = Testimonial.objects.filter(user=user, seminar=seminar)
             if not testimonials:
                 testimonial = Testimonial(user=user, seminar=seminar)
+                now = datetime.datetime.now()
+                if seminar.expiry_date < now:
+                    testimonial.date_modified = seminar.expiry_date
+
                 testimonial.save()
                 # text = render_to_string('teleforma/messages/seminar_validated.txt', context)
                 # subject = seminar.title + ' : ' + unicode(_('all your answers has been validated'))