mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 07:10:59 +00:00
Don't error when we don't have a parent post
This commit is contained in:
parent
834282cf54
commit
365b9d49c6
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ class PostService:
|
||||||
ancestors: list[Post] = []
|
ancestors: list[Post] = []
|
||||||
ancestor = self.post
|
ancestor = self.post
|
||||||
while ancestor.in_reply_to and len(ancestors) < num_ancestors:
|
while ancestor.in_reply_to and len(ancestors) < num_ancestors:
|
||||||
ancestor = self.queryset().get(object_uri=ancestor.in_reply_to)
|
ancestor = self.queryset().filter(object_uri=ancestor.in_reply_to).first()
|
||||||
if ancestor is None:
|
if ancestor is None:
|
||||||
break
|
break
|
||||||
if ancestor.state in [PostStates.deleted, PostStates.deleted_fanned_out]:
|
if ancestor.state in [PostStates.deleted, PostStates.deleted_fanned_out]:
|
||||||
|
|
Loading…
Reference in a new issue