Fix result index bug introduced in previous commit
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 14s
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 14s
This commit is contained in:
@ -43,10 +43,7 @@ class TemplateModel:
|
|||||||
self.active_user = self.user_by(user_name=active_user_name, ignore=["Everyone"])
|
self.active_user = self.user_by(user_name=active_user_name, ignore=["Everyone"])
|
||||||
|
|
||||||
if active_result_race_name is not None:
|
if active_result_race_name is not None:
|
||||||
if active_result_race_name == "Current":
|
self.active_result = self.race_result_by(race_name=active_result_race_name)
|
||||||
self.active_result = self.all_race_results()[0]
|
|
||||||
else:
|
|
||||||
self.active_result = self.race_result_by(race_name=active_result_race_name)
|
|
||||||
|
|
||||||
def race_guess_open(self, race: Race) -> bool:
|
def race_guess_open(self, race: Race) -> bool:
|
||||||
return not race_has_started(race=race)
|
return not race_has_started(race=race)
|
||||||
@ -265,16 +262,16 @@ class TemplateModel:
|
|||||||
return self.active_result.race.name
|
return self.active_result.race.name
|
||||||
elif self.current_race is not None:
|
elif self.current_race is not None:
|
||||||
return self.current_race.name
|
return self.current_race.name
|
||||||
|
else:
|
||||||
raise Exception("active_result_name_or_current_race_name called without active_result or current_race")
|
return self.all_races()[0].name
|
||||||
|
|
||||||
def active_result_race_name_or_current_race_name_sanitized(self) -> str:
|
def active_result_race_name_or_current_race_name_sanitized(self) -> str:
|
||||||
if self.active_result is not None:
|
if self.active_result is not None:
|
||||||
return self.active_result.race.name_sanitized
|
return self.active_result.race.name_sanitized
|
||||||
elif self.current_race is not None:
|
elif self.current_race is not None:
|
||||||
return self.current_race.name_sanitized
|
return self.current_race.name_sanitized
|
||||||
|
else:
|
||||||
raise Exception("active_result_race_name_or_current_race_name_sanitized called without active_result or current_race")
|
return self.all_races()[0].name_sanitized
|
||||||
|
|
||||||
def all_teams(self, *, include_none: bool) -> List[Team]:
|
def all_teams(self, *, include_none: bool) -> List[Team]:
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user