Skip to content

Commit

Permalink
Fix for optional References in token trees (#2164)
Browse files Browse the repository at this point in the history
Signed-off-by: ammar <[email protected]>
Co-authored-by: Jeroen Dekkers <[email protected]>
  • Loading branch information
ammar92 and dekkers authored Dec 19, 2023
1 parent cec75e9 commit 18ee8e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion octopoes/octopoes/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def build_token_tree(ooi_class: Type[OOI]) -> Dict:
field = ooi_class.model_fields[attribute]
value = ""

if field.annotation == Reference:
if field.annotation in (Reference, Optional[Reference]):
from octopoes.models.types import related_object_type

related_class = related_object_type(field)
Expand Down

0 comments on commit 18ee8e6

Please sign in to comment.