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

pull/265/head
Andrew Godwin 2022-12-24 12:27:37 -07:00
rodzic 834282cf54
commit 365b9d49c6
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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]: