]> git.parisson.com Git - teleforma.git/commitdiff
fix validated semainar
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 24 Nov 2014 16:46:45 +0000 (17:46 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 24 Nov 2014 16:46:45 +0000 (17:46 +0100)
teleforma/management/commands/teleforma-increase-revision-time.py

index 75391cd027748f22f806c0983ce53586643391cf..b313bd594d988a7dc467653dc83f2abac3deb979 100644 (file)
@@ -31,10 +31,12 @@ class Command(BaseCommand):
                 for seminar in seminars:
                     revisions = SeminarRevision.objects.filter(user=user, seminar=seminar)
                     if revisions:
+                        progress = seminar_progress(user, seminar)
+                        validated = seminar_validated(user, seminar)
                         timer = get_seminar_timer(user, seminar)
                         bonus = datetime.timedelta(seconds=seminar.duration.as_seconds())
                         delta = timer - bonus
-                        if delta.total_seconds() < 0:
+                        if delta.total_seconds() < 0 and progress == 100 and validated:
                             if not revisions[0].date_modified:
                                 if len(revisions) > 1:
                                     revision = revisions[1]