Skip to content

Commit

Permalink
#145 - Criação de campeonato com round default 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Reginaldo-Neto committed Jun 18, 2023
1 parent 528853e commit 7629ea7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/api/routers/championships_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def create(data: ChampionshipInput, token: Annotated[str, Depends(oauth2_s
max_teams=data.max_teams,
format=data.format,
rules=data.rules,
round=data.round,
round=0,
contact=data.contact,
visibility=data.visibility,
admin_id=user.id,
Expand Down
3 changes: 1 addition & 2 deletions backend/api/schemas/championships.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class ChampionshipInput(ChampionshipSchema):
prizes: str
format: EnumFormat
rules: str
round: int
contact: str
visibility: EnumVisibility
game_id: int
Expand All @@ -71,7 +70,7 @@ def min_teams_greater_than_zero(cls, v):
if v <= 1:
raise ValueError("The minimum number of teams must be greater than one")
return v

@validator("max_teams")
def max_teams_greater_than_min_teams(cls, v, values):
if "min_teams" in values and v < values["min_teams"]:
Expand Down

0 comments on commit 7629ea7

Please sign in to comment.