]> git.parisson.com Git - teleforma.git/commitdiff
fix issue with duration display error
authorYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 16 Jun 2020 07:51:21 +0000 (09:51 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 16 Jun 2020 07:51:21 +0000 (09:51 +0200)
teleforma/models/core.py
teleforma/templates/teleforma/course_webclass.html

index 338dd622200d833fafa8b2c025b2d515af2f47f5..b6a373f228bbf1499571d771206c08e71409bfd9 100755 (executable)
@@ -667,11 +667,10 @@ class WebclassMixin(Model):
     
     @property
     def webclass_duration(self):
+        """ in seconds """
         if self.webclass_hours_complementary:
-            seconds = self.duration.as_seconds() - self.webclass_hours_complementary.as_seconds()
-        else:
-            seconds = self.duration.as_seconds()
-        return datetime.timedelta(seconds=seconds)
+            return (self.duration.as_seconds() - self.webclass_hours_complementary.as_seconds())
+        return self.duration.as_seconds()
 
     # def clean(self):
     #     if self.start_date > self.end_date::
index 6431f00c377017f80c314db94604360c5a7098e4..85d7d8f94064d414911c97a397ebbbf9caab87f2 100644 (file)
@@ -91,7 +91,7 @@
             {% comment %} <dt>{% trans "Live" %}</dt>
             <dd>{% if is_webclass_running %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</dd> {% endcomment %}
             <dt>{% trans "Duration" %}</dt>
-            <dd>{{ conference.webclass_duration.seconds|fancy_seconds }}</dd>
+            <dd>{{ conference.webclass_duration|fancy_seconds }}</dd>
             <dt>{% trans "Live" %}</dt>
             <dd>{% trans "Yes" %}</dd>
             {% comment %} {% if conference.room %}<dt>{% trans "Room" %}</dt>