From 6ae7b60ef40bf3111b1332951cc13aae0eab79cb Mon Sep 17 00:00:00 2001 From: Leonid Date: Wed, 25 Dec 2019 11:21:47 +0300 Subject: [PATCH] fix error format time_spent --- helpdesk/lib.py | 6 +++--- helpdesk/models.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helpdesk/lib.py b/helpdesk/lib.py index 9a48af5b..0895ab7b 100644 --- a/helpdesk/lib.py +++ b/helpdesk/lib.py @@ -161,9 +161,9 @@ def format_time_spent(time_spent): """ if time_spent: - time_spent = "{0:02d}h:{0:02d}m".format( - int(time_spent.total_seconds() // 3600), - int((time_spent.total_seconds() % 3600) / 60) + time_spent = "{0:02d}h:{1:02d}m".format( + time_spent.seconds // 3600, + time_spent.seconds // 60 ) else: time_spent = "" diff --git a/helpdesk/models.py b/helpdesk/models.py index 339f4c9f..c724a0c3 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -35,9 +35,9 @@ from .templated_email import send_templated_mail def format_time_spent(time_spent): if time_spent: - time_spent = "{0:02d}h:{0:02d}m".format( - int(time_spent.total_seconds() // (3600)), - int((time_spent.total_seconds() % 3600) / 60) + time_spent = "{0:02d}h:{1:02d}m".format( + time_spent.seconds // 3600, + time_spent.seconds // 60 ) else: time_spent = ""