diff --git a/files/routes/users.py b/files/routes/users.py index b6439533a..f5c73e4c1 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -108,7 +108,9 @@ def messagereply(v, username, id): Comment.sentto == user.id, CommentAux.body == message, ).options(contains_eager(Comment.comment_aux)).first() - if existing: return redirect(f'/notifications?messages=true#comment-{existing.id}') + if existing: + if existing.parent_comment_id: return redirect(f'/notifications?messages=true#comment-{existing.parent_comment_id}') + else: return redirect(f'/notifications?messages=true#comment-{existing.id}') with CustomRenderer() as renderer: text_html = renderer.render(mistletoe.Document(message)) text_html = sanitize(text_html)