Don't error when we don't have a parent post

This commit is contained in:
Andrew Godwin 2022-12-24 12:27:37 -07:00
parent 834282cf54
commit 365b9d49c6

View file

@ -97,7 +97,7 @@ class PostService:
ancestors: list[Post] = []
ancestor = self.post
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:
break
if ancestor.state in [PostStates.deleted, PostStates.deleted_fanned_out]: