vc
This commit is contained in:
parent
fb95e99910
commit
b3eef22afa
1 changed files with 5 additions and 2 deletions
|
@ -787,8 +787,7 @@ def undelete_comment(cid, v):
|
||||||
|
|
||||||
c = g.db.query(Comment).filter_by(id=cid).one_or_none()
|
c = g.db.query(Comment).filter_by(id=cid).one_or_none()
|
||||||
|
|
||||||
if not c:
|
if not c: abort(404)
|
||||||
abort(404)
|
|
||||||
|
|
||||||
if c.author_id != v.id:
|
if c.author_id != v.id:
|
||||||
abort(403)
|
abort(403)
|
||||||
|
@ -810,6 +809,8 @@ def pin_comment(cid, v):
|
||||||
|
|
||||||
comment = get_comment(cid, v=v)
|
comment = get_comment(cid, v=v)
|
||||||
|
|
||||||
|
if not comment: abort(404)
|
||||||
|
|
||||||
if v.id != comment.post.author_id: abort(403)
|
if v.id != comment.post.author_id: abort(403)
|
||||||
|
|
||||||
comment.is_pinned = v.username + " (OP)"
|
comment.is_pinned = v.username + " (OP)"
|
||||||
|
@ -830,6 +831,8 @@ def unpin_comment(cid, v):
|
||||||
|
|
||||||
comment = get_comment(cid, v=v)
|
comment = get_comment(cid, v=v)
|
||||||
|
|
||||||
|
if not comment: abort(404)
|
||||||
|
|
||||||
if v.id != comment.post.author_id: abort(403)
|
if v.id != comment.post.author_id: abort(403)
|
||||||
|
|
||||||
if not comment.is_pinned.endswith(" (OP)"):
|
if not comment.is_pinned.endswith(" (OP)"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue