progress
This commit is contained in:
parent
a8111c45e9
commit
cfc3aeae43
@ -19,7 +19,12 @@ class Progress(models.Model):
|
|||||||
def time(self):
|
def time(self):
|
||||||
if not self.finished:
|
if not self.finished:
|
||||||
self.finished_time = timezone.now()
|
self.finished_time = timezone.now()
|
||||||
return self.finished_time - self.start_time
|
seconds = (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}"
|
||||||
|
|
||||||
def increment_rating(self):
|
def increment_rating(self):
|
||||||
if self.task.creator == self.user:
|
if self.task.creator == self.user:
|
||||||
|
Loading…
Reference in New Issue
Block a user