Razmig Sarkissian 6 months ago
commit 30ec5034cd
  1. 9
      tournaments/models/match.py

@ -348,6 +348,15 @@ class Match(SideStoreModel):
return format_seconds(self.smart_time_played())
def smart_time_played(self):
if self.start_date:
if self.end_date:
return self.__smart_duration()
else:
return (timezone.now() - self.start_date).total_seconds()
else:
return 0
def __smart_duration(self):
seconds = (self.end_date - self.start_date).total_seconds()
average_duration = self.average_seconds_duration()

Loading…
Cancel
Save