fix edge case with pinning child comments

master
Aevann1 2022-09-02 06:13:40 +02:00
parent 40cb5b4139
commit 8ed450e980
1 changed files with 2 additions and 1 deletions

View File

@ -224,7 +224,8 @@ def post_id(pid, anything=None, v=None, sub=None):
pinned.remove(pin)
elif pin.level > 1:
pinned.remove(pin)
pinned.append(pin.top_comment)
if pin.top_comment not in pinned:
pinned.append(pin.top_comment)
if pin.top_comment in comments:
comments.remove(pin.top_comment)