dfsfdssdf
This commit is contained in:
parent
0e505e894e
commit
58ca19e1b4
1 changed files with 1 additions and 9 deletions
|
@ -278,6 +278,7 @@ def message2(v, username):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/reply")
|
@app.post("/reply")
|
||||||
|
@limiter.limit("6/minute")
|
||||||
@auth_required
|
@auth_required
|
||||||
def messagereply(v):
|
def messagereply(v):
|
||||||
|
|
||||||
|
@ -287,15 +288,6 @@ def messagereply(v):
|
||||||
user = parent.author
|
user = parent.author
|
||||||
message = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', message)
|
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 = Renderer().render(mistletoe.Document(message))
|
||||||
text_html = sanitize(text_html, True)
|
text_html = sanitize(text_html, True)
|
||||||
new_comment = Comment(author_id=v.id,
|
new_comment = Comment(author_id=v.id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue