]> git.parisson.com Git - teleforma.git/commitdiff
testimonial.date_modified as seminar.expiry_date if bigger
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 30 Dec 2013 19:14:35 +0000 (20:14 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 30 Dec 2013 19:14:35 +0000 (20:14 +0100)
teleforma/views/pro.py

index 17ffac2364fc26d2e9d2dd4a5029046c60267fdd..4f1ec5039f6baece0942823a9911caf976190dcc 100644 (file)
@@ -49,7 +49,7 @@ from django.views.generic.detail import SingleObjectMixin
 from django.core.mail import EmailMessage
 from django.template.loader import render_to_string
 
-import os
+import os, datetime
 from cgi import escape
 from cStringIO import StringIO
 
@@ -327,6 +327,9 @@ class AnswersView(ListView):
 
         if seminar_validated(user, seminar):
             testimonial = Testimonial(user=user, seminar=seminar)
+            now = datetime.datetime.now()
+            if context['date'] < now:
+                testimonial.date_modified = context['date']
             testimonial.save()
             # url = reverse('teleforma-seminar-testimonial-download', kwargs={'pk':seminar.id}) + '?format=pdf'
             text = render_to_string('teleforma/messages/seminar_validated.txt', context)