|
|
|
@ -125,7 +125,21 @@ class Match(models.Model): |
|
|
|
if self.end_date: |
|
|
|
if self.end_date: |
|
|
|
return (self.end_date - self.start_date).total_seconds() |
|
|
|
return (self.end_date - self.start_date).total_seconds() |
|
|
|
else: |
|
|
|
else: |
|
|
|
return (timezone.now() - self.start_date).total_seconds() |
|
|
|
current = (timezone.now() - self.start_date).total_seconds() |
|
|
|
|
|
|
|
if self.total_number_of_games() > 0 and current < self.average_seconds_duration() * 4: |
|
|
|
|
|
|
|
return current |
|
|
|
|
|
|
|
elif self.total_number_of_games() == 0 and current < 4 * 60 * 60: |
|
|
|
|
|
|
|
return current |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
return None |
|
|
|
|
|
|
|
# print(current) |
|
|
|
|
|
|
|
# print(self.average_seconds_duration()) |
|
|
|
|
|
|
|
# print('*******') |
|
|
|
|
|
|
|
# if current < self.average_seconds_duration() * 4: |
|
|
|
|
|
|
|
# return current |
|
|
|
|
|
|
|
# else: |
|
|
|
|
|
|
|
# return None |
|
|
|
|
|
|
|
# return (timezone.now() - self.start_date).total_seconds() |
|
|
|
else: |
|
|
|
else: |
|
|
|
return 0 |
|
|
|
return 0 |
|
|
|
|
|
|
|
|
|
|
|
|