dfsfdssdf

remotes/1693045480750635534/spooky-22
Aevann1 2021-10-04 01:17:36 +02:00
parent 87a4e15499
commit 14cf3a896a
1 changed files with 1 additions and 9 deletions

View File

@ -278,6 +278,7 @@ def message2(v, username):
@app.post("/reply")
@limiter.limit("6/minute")
@auth_required
def messagereply(v):
@ -287,15 +288,6 @@ def messagereply(v):
user = parent.author
message = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', message)
# check existing
existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == v.id,
Comment.sentto == user.id,
Comment.body == message,
).first()
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}')
text_html = Renderer().render(mistletoe.Document(message))
text_html = sanitize(text_html, True)
new_comment = Comment(author_id=v.id,