Skip to content

Commit

Permalink
Make sure internal_id None is disregarded (#3667) (patch)
Browse files Browse the repository at this point in the history
### Fixed

- Discriminator can handle None
  • Loading branch information
islean authored Aug 30, 2024
1 parent 36a1c10 commit 560e5c2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

def has_internal_id(v: Any) -> str:
if isinstance(v, dict):
return "existing" if "internal_id" in v.keys() else "new"
return "existing" if v.get("internal_id") else "new"
return "existing" if getattr(v, "internal_id", None) else "new"

0 comments on commit 560e5c2

Please sign in to comment.