Skip to content

Commit b96e94f

Browse files
committed
Update forward references for recursive block types
- Modified `blocks.py` and `message_body.py` to use `update_forward_refs()` instead of deprecated `model_rebuild()`
1 parent 9c142c3 commit b96e94f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

elementary/messages/blocks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,5 @@ class ExpandableBlock(BaseBlock):
123123
"ExpandableBlock",
124124
]
125125

126-
ExpandableBlock.model_rebuild()
126+
# Update forward references for recursive types
127+
ExpandableBlock.update_forward_refs(**locals())

elementary/messages/message_body.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ class MessageBody(BaseModel):
3434
color: Optional[Color] = None
3535

3636

37-
MessageBody.model_rebuild()
37+
MessageBody.update_forward_refs(**locals())

0 commit comments

Comments
 (0)