]> git.parisson.com Git - teleforma.git/commitdiff
Fix duration computation for testimonial award
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 12 Nov 2025 08:39:15 +0000 (09:39 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 12 Nov 2025 08:39:15 +0000 (09:39 +0100)
teleforma/management/commands/teleforma-revisions-from-bbb.py

index e0abe4322aec715458a5ceca02f47d62f469539c..6271a8fe5656832c253f67360d8e5b2ff45f8afd 100644 (file)
@@ -117,7 +117,8 @@ class Command(BaseCommand):
                 for revision in revisions:
                     total_spent += revision.delta()
 
-                required_duration = conf.duration.as_seconds() * 0.9
+                required_duration = (conf.date_end - conf.date_begin).total_seconds() * 0.9
+                
                 # print("Required duration: %d seconds" % required_duration)
                 # print("Total spent: %d seconds" % total_spent.total_seconds())
                 if total_spent.total_seconds() >= required_duration: