Skip to content

Commit

Permalink
Merge pull request #791 from stilet/bugfix_time_spent
Browse files Browse the repository at this point in the history
fix error format time_spent
  • Loading branch information
gwasser committed Dec 25, 2019
2 parents 39de3ec + 6ae7b60 commit 65943e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions helpdesk/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
6 changes: 3 additions & 3 deletions helpdesk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,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 = ""
Expand Down

0 comments on commit 65943e8

Please sign in to comment.