Fix unset parent variable when viewing top post (#119)

This commit is contained in:
Michael Manfre 2022-12-05 18:07:18 -05:00 committed by GitHub
parent 238268eb31
commit da9a3d853e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,11 +34,12 @@ class Individual(TemplateView):
return super().get(request)
def get_context_data(self):
parent = None
if self.post_obj.in_reply_to:
try:
parent = Post.by_object_uri(self.post_obj.in_reply_to, fetch=True)
except Post.DoesNotExist:
parent = None
pass
return {
"identity": self.identity,
"post": self.post_obj,