Fix: Generating permalinks for comments 500's if the associated post isn't loaded.

This commit is contained in:
Ben Rog-Wilhelm 2023-03-16 10:49:21 -05:00
parent a060f5840c
commit 79b49342ba

View file

@ -266,7 +266,10 @@ class Comment(Base):
@property
@lazy
def shortlink(self):
if self.post:
return f"{self.post.shortlink}/{self.id}?context=8#context"
else:
return f"/comment/{self.id}?context=8#context"
@property
@lazy