|
|
|
@ -549,7 +549,7 @@ class Tournament(models.Model): |
|
|
|
def last_started_match(self): |
|
|
|
def last_started_match(self): |
|
|
|
matches = [m for m in self.all_matches(False) if m.start_date] |
|
|
|
matches = [m for m in self.all_matches(False) if m.start_date] |
|
|
|
matches.sort(key=lambda m: m.start_date, reverse=True) |
|
|
|
matches.sort(key=lambda m: m.start_date, reverse=True) |
|
|
|
return matches[0] |
|
|
|
return matches.get(0) # get returns None if not present |
|
|
|
|
|
|
|
|
|
|
|
def round_for_index(self, index): |
|
|
|
def round_for_index(self, index): |
|
|
|
return self.round_set.filter(index=index, parent=None).first() |
|
|
|
return self.round_set.filter(index=index, parent=None).first() |
|
|
|
|