Skip to content

Commit

Permalink
Fix possible KeyError in ZZZNotes
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Nov 22, 2024
1 parent 28ce2e9 commit 669bf1f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions genshin/models/zzz/chronicle/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ def __transform_value(cls, v: typing.Literal["CardSignDone", "CardSignNotDone"])

@pydantic.model_validator(mode="before")
def __unnest_value(cls, values: dict[str, typing.Any]) -> dict[str, typing.Any]:
values["video_store_state"] = values["vhs_sale"]["sale_state"]
values["hollow_zero"] = {
"bounty_commission": values["bounty_commission"],
"survey_points": values["survey_points"],
}
if "video_store_state" not in values:
values["video_store_state"] = values["vhs_sale"]["sale_state"]
if "hollow_zero" not in values:
values["hollow_zero"] = {
"bounty_commission": values["bounty_commission"],
"survey_points": values["survey_points"],
}
return values

0 comments on commit 669bf1f

Please sign in to comment.