Skip to content

Commit

Permalink
Fix ValidationError on PartialLineupCharacter
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Aug 31, 2024
1 parent a25c76b commit 54070b5
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions genshin/models/genshin/lineup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ class PartialLineupCharacter(character.BaseCharacter):
icon: str = Aliased("head_icon")
pc_icon: str = Aliased("standard_icon")

def __init__(self, _frame: int = 1, **data: typing.Any) -> None:
# rename "icon" due to pydantic's aliasing
icons_amount = sum(1 for key, value in data.items() if "icon" in key if value)
if data.get("pc_icon") and data.get("icon"):
...
elif icons_amount >= 2 and "static" in data.get("icon", ""):
data["pc_icon"] = data.pop("icon")

super().__init__(_frame=_frame + 3, **data) # type: ignore

@pydantic.validator("element", pre=True)
def __parse_element(cls, value: typing.Any) -> str:
if isinstance(value, str) and not value.isdigit():
Expand Down

0 comments on commit 54070b5

Please sign in to comment.