bracket-feature
Laurent 11 months ago
parent 217982be11
commit 71c5da7de3
  1. 2
      tournaments/admin.py
  2. 1
      tournaments/models/tournament.py

@ -69,7 +69,7 @@ class PlayerRegistrationAdmin(admin.ModelAdmin):
ordering = ['last_name', 'first_name'] ordering = ['last_name', 'first_name']
class MatchAdmin(admin.ModelAdmin): class MatchAdmin(admin.ModelAdmin):
list_display = ['__str__', 'round', 'group_stage', 'start_date', 'index'] list_display = ['__str__', 'round', 'group_stage', 'start_date', 'end_date', 'index']
list_filter = [MatchTypeListFilter, MatchTournamentListFilter, SimpleIndexListFilter] list_filter = [MatchTypeListFilter, MatchTournamentListFilter, SimpleIndexListFilter]
ordering = ['-group_stage', 'round'] ordering = ['-group_stage', 'round']

@ -669,6 +669,7 @@ class Tournament(models.Model):
def first_unfinished_match(self): def first_unfinished_match(self):
matches = [m for m in self.all_matches(False) if m.start_date and m.end_date is None] matches = [m for m in self.all_matches(False) if m.start_date and m.end_date is None]
print(f'first_unfinished_match > match len: {len(matches)}')
matches.sort(key=lambda m: m.start_date) matches.sort(key=lambda m: m.start_date)
if matches: if matches:
return matches[0] return matches[0]

Loading…
Cancel
Save