Skip to content

Commit

Permalink
fix: don't show in league results unless you have atleast 1 point
Browse files Browse the repository at this point in the history
  • Loading branch information
brownben committed Apr 13, 2024
1 parent 8a827b6 commit f802970
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
7 changes: 4 additions & 3 deletions backend/src/routes/leagues.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async def delete_league(
async def get_league_events(
league_name: str = Path(
title="League Name",
description="Name of the league to get the results for",
description="Name of the league",
example="Sprintelope 2021",
),
) -> Iterable[EventWithLeagueDetailsAndUploadKey]:
Expand Down Expand Up @@ -187,7 +187,7 @@ def generate_event_calendar_description(event: EventWithLeagueDetails) -> str:
async def get_league_events_calendar(
league_name: str = Path(
title="League Name",
description="Name of the league to get the results for",
description="Name of the league",
example="Sprintelope 2021",
),
) -> PlainTextResponse:
Expand Down Expand Up @@ -323,6 +323,7 @@ async def get_league_results(
result
for result in league_results.values()
if any([points is not None for points in result.points])
and result.total_points > 0
]
results.sort(
key=lambda x: x.total_points,
Expand All @@ -343,7 +344,7 @@ async def get_league_results(
async def get_league_classes(
league_name: str = Path(
title="League Name",
description="Name of the league ",
description="Name of the league",
example="Sprintelope 2021",
),
) -> Iterable[LeagueClass]:
Expand Down
17 changes: 0 additions & 17 deletions backend/src/routes/tests/test_leagues.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,23 +433,6 @@ def test_sample_data(self) -> None:
},
],
},
{
"id": 4,
"name": "Freya Smith",
"club": "HAT",
"age_class": "W55",
"total_points": 0,
"position": 4,
"points": [
None,
{
"event": "TheFinalCountdown-2021-12-24",
"score": 0,
"counting": 1,
"type": "",
},
],
},
],
},
)
Expand Down

0 comments on commit f802970

Please sign in to comment.