fix duplicate comments in /@<user>/comments

master
Aevann 2023-03-22 21:39:50 +02:00
parent bcf1810b7b
commit 5b8da52ab8
1 changed files with 2 additions and 1 deletions

View File

@ -1032,10 +1032,11 @@ def u_username_comments(username, v=None):
listing = [] listing = []
for x in comments: for x in comments:
x.replies2 = [] if x.replies2 == None: x.replies2 = []
if x.parent_comment_id: if x.parent_comment_id:
x.parent_comment.replies2 = [x] x.parent_comment.replies2 = [x]
x = x.parent_comment x = x.parent_comment
if x.id in ids: continue
listing.append(x) listing.append(x)
ids += [x.id for x in listing] ids += [x.id for x in listing]