Skip to content

Commit

Permalink
Team Formation: Allow renaming empty deck.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuAuahDark committed Apr 17, 2024
1 parent f5687e2 commit 360ce76
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions npps4/game/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ async def unit_setdisplayrank(context: idol.SchoolIdolUserParams, request: UnitS
@idol.register("unit", "deckName")
async def unit_deckname(context: idol.SchoolIdolUserParams, request: UnitDeckNameRequest) -> None:
current_user = await user.get_current(context)
deck_data = await unit.load_unit_deck(context, current_user, request.unit_deck_id)
if deck_data is None:
raise idol.error.IdolError(detail="Invalid target deck")

deck_data = await unit.load_unit_deck(context, current_user, request.unit_deck_id, True)
await advanced.test_name(context, request.deck_name)

deck_data[0].name = request.deck_name
Expand Down

0 comments on commit 360ce76

Please sign in to comment.