diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index 7dc0eaf..d26639d 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.py @@ -42,8 +42,8 @@ class TeamRegistration(models.Model): matches = [m for m in all_matches if m.end_date is None] if matches: return matches[0] - elif all_matches: - return all_matches[0] + else: + return None def next_stage(self): matches = map(lambda ts: ts.match, self.teamscore_set.all())