Skip to content

Commit

Permalink
fix Service.get_objectid_fields() + version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
volfpeter committed Aug 6, 2024
1 parent 72025e9 commit 0aad6eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions motorhead/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,11 @@ def get_objectid_fields(cls, model: type[BaseModel]) -> set[str]:
continue

if args := get_args(info.annotation):
if any(issubclass(a, ObjectId) for a in args):
result.add(name)
try:
if any(issubclass(a, ObjectId) for a in args):
result.add(name)
except TypeError:
continue
elif issubclass(info.annotation, ObjectId):
result.add(name)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tracker = "https://github.com/volfpeter/motorhead/issues"

[tool.poetry]
name = "motorhead"
version = "0.2403.0"
version = "0.2408.0"
description = "Async MongoDB with vanilla Pydantic v2+ - made easy."
authors = ["Peter Volf <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 0aad6eb

Please sign in to comment.