Fix: Generating permalinks for comments 500's if the associated post isn't loaded.
This commit is contained in:
parent
a060f5840c
commit
79b49342ba
1 changed files with 4 additions and 1 deletions
|
@ -266,7 +266,10 @@ class Comment(Base):
|
|||
@property
|
||||
@lazy
|
||||
def shortlink(self):
|
||||
return f"{self.post.shortlink}/{self.id}?context=8#context"
|
||||
if self.post:
|
||||
return f"{self.post.shortlink}/{self.id}?context=8#context"
|
||||
else:
|
||||
return f"/comment/{self.id}?context=8#context"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue