From 68c546914cef8c76c13ab762f4e13a65aa5c692e Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 20 Oct 2024 15:38:30 +0800 Subject: [PATCH] fix: bsky post when reply delete --- models/models/bsky.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/models/models/bsky.py b/models/models/bsky.py index 20c9533..e263739 100644 --- a/models/models/bsky.py +++ b/models/models/bsky.py @@ -166,7 +166,8 @@ class HumanPost(BaseModel, frozen=False): parent_post = None if data.reply: is_reply = True - parent_post = HumanPost.parse_view(data.reply.parent) + if hasattr(data.reply.parent, "post"): + parent_post = HumanPost.parse_view(data.reply.parent) elif data.reason: is_repost = True elif data.post.embed and isinstance(data.post.embed, BskyViewRecord): @@ -186,7 +187,8 @@ class HumanPost(BaseModel, frozen=False): parent_post = None if data.parent: is_reply = True - parent_post = HumanPost.parse_view(data.parent.post) + if hasattr(data.parent, "post"): + parent_post = HumanPost.parse_view(data.parent.post) elif data.post.embed and isinstance(data.post.embed, BskyViewRecord): is_quote = True if isinstance(data.post.embed.record, BskyViewRecordRecord):