This commit is contained in:
Egor Matveev 2021-11-12 01:46:58 +03:00
parent 8d3399c598
commit 7b5ee5531c

View File

@ -19,12 +19,7 @@ class Progress(models.Model):
def time(self):
if not self.finished:
self.finished_time = timezone.now()
seconds = int((self.finished_time - self.start_time).total_seconds())
hours = seconds // 3600
seconds -= hours * 3600
minutes = seconds // 60
seconds -= minutes * 60
return f"{hours}:{minutes}:{seconds}"
return self.finished_time - self.start_time
def increment_rating(self):
if self.task.creator == self.user: