Removed some ghost bracket, hidden rest match and better rendering and score submitting
This commit is contained in:
@@ -42,13 +42,17 @@ async def report_score(
|
||||
if not report.sets:
|
||||
raise HTTPException(400, "No sets submitted")
|
||||
|
||||
if match.winner_team_id:
|
||||
logic.undo_advancement(db, match)
|
||||
|
||||
_apply_score(match, report.sets)
|
||||
flag_modified(match, "sets")
|
||||
db.commit()
|
||||
|
||||
if match.winner_team_id:
|
||||
logic.advance_winner(db, match, match.winner_team_id)
|
||||
|
||||
db.commit()
|
||||
|
||||
await send_ws_update(id)
|
||||
return SUCCESS
|
||||
|
||||
@@ -77,11 +81,12 @@ async def edit_score(
|
||||
_apply_score(match, report.sets)
|
||||
|
||||
flag_modified(match, "sets")
|
||||
db.commit()
|
||||
|
||||
if match.winner_team_id:
|
||||
logic.advance_winner(db, match, match.winner_team_id)
|
||||
|
||||
db.commit()
|
||||
|
||||
await send_ws_update(id)
|
||||
return SUCCESS
|
||||
|
||||
@@ -107,7 +112,10 @@ async def clear_score(
|
||||
logic.undo_advancement(db, match)
|
||||
|
||||
match.winner_team_id = None
|
||||
match.status = MatchStatus.PENDING
|
||||
if match.p1_team_id and match.p2_team_id:
|
||||
match.status = MatchStatus.PENDING
|
||||
else:
|
||||
match.status = MatchStatus.SCHEDULED
|
||||
match.sets = []
|
||||
|
||||
flag_modified(match, "sets")
|
||||
|
||||
Reference in New Issue
Block a user