Skip to content

Commit 18ee8e6

Browse files
ammar92dekkers
andauthored
Fix for optional References in token trees (#2164)
Signed-off-by: ammar <ammar.abdulamir@gmail.com> Co-authored-by: Jeroen Dekkers <jeroen@dekkers.ch>
1 parent cec75e9 commit 18ee8e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

octopoes/octopoes/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def build_token_tree(ooi_class: Type[OOI]) -> Dict:
265265
field = ooi_class.model_fields[attribute]
266266
value = ""
267267

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

271271
related_class = related_object_type(field)

0 commit comments

Comments
 (0)