|
|
|
@ -468,11 +468,14 @@ class Tournament(models.Model): |
|
|
|
return False |
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
def display_tournament(self): |
|
|
|
def display_tournament(self): |
|
|
|
if self.end_date is not None: |
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|
if self.publish_tournament: |
|
|
|
if self.publish_tournament: |
|
|
|
return True |
|
|
|
return True |
|
|
|
if (len(self.groupstage_set.all()) > 0 or len(self.round_set.all()) > 0) and len(self.teamregistration_set.all()) >= 4: |
|
|
|
is_build_and_not_empty = self.is_build_and_not_empty() |
|
|
|
|
|
|
|
if self.end_date is not None: |
|
|
|
|
|
|
|
if self.is_canceled is True: |
|
|
|
|
|
|
|
return is_build_and_not_empty |
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|
if is_build_and_not_empty is True: |
|
|
|
if datetime.now().date() >= self.start_date.date(): |
|
|
|
if datetime.now().date() >= self.start_date.date(): |
|
|
|
return True |
|
|
|
return True |
|
|
|
minimum_publish_date = self.creation_date.replace(hour=9, minute=0) + timedelta(days=1) |
|
|
|
minimum_publish_date = self.creation_date.replace(hour=9, minute=0) + timedelta(days=1) |
|
|
|
@ -574,6 +577,9 @@ class Tournament(models.Model): |
|
|
|
def hide_weight(self): |
|
|
|
def hide_weight(self): |
|
|
|
return self.federal_level_category == FederalLevelCategory.UNLISTED |
|
|
|
return self.federal_level_category == FederalLevelCategory.UNLISTED |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_build_and_not_empty(self): |
|
|
|
|
|
|
|
return (len(self.groupstage_set.all()) > 0 or len(self.round_set.all()) > 0) and len(self.teamregistration_set.all()) >= 4 |
|
|
|
|
|
|
|
|
|
|
|
class MatchGroup: |
|
|
|
class MatchGroup: |
|
|
|
def __init__(self, name, matches): |
|
|
|
def __init__(self, name, matches): |
|
|
|
self.name = name |
|
|
|
self.name = name |
|
|
|
|