From dc954d18a2b2256034734539a24d80ccd50d64fc Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 21 Nov 2014 16:28:34 +0100 Subject: [PATCH] fix seminar time --- teleforma/views/pro.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 2bde72a6..dee3e555 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -169,7 +169,8 @@ class SeminarView(SeminarAccessMixin, DetailView): delta = self.get_delta(user, seminar) time = delta - datetime.timedelta(seconds=seminar.duration.as_seconds()) - context['seminar_time'] = time.total_seconds() + seminar_time = time.total_seconds() + context['seminar_time'] = seminar_time context['delta'] = str(delta).split('.')[0] if progress == 100 and not validated and self.template_name == 'teleforma/seminar_detail.html': @@ -178,7 +179,7 @@ class SeminarView(SeminarAccessMixin, DetailView): messages.info(self.request, _("All your answers have been validated. You can now read the corrected documents (step 5).")) elif progress == 100 and validated and self.template_name == 'teleforma/seminar_detail.html': messages.info(self.request, _("You have successfully terminated all steps of your e-learning seminar. You can now download your training testimonial below.")) - if progress == 100 and validated and time <= 0: + if progress == 100 and validated and seminar_time <= 0: messages.info(self.request, _("Your connexion time is not sufficient. In order to get your testimonial, you have to work at least the time required for this seminar.")) return context -- 2.39.5