From 8ed450e980def0d7acf3372bc82c5f0ce722c489 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 2 Sep 2022 06:13:40 +0200 Subject: [PATCH] fix edge case with pinning child comments --- files/routes/posts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 5dcffe58e..d15325eb4 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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)