xvc
This commit is contained in:
parent
9f0bc6d62c
commit
50aae30774
3 changed files with 10 additions and 18 deletions
|
@ -1024,16 +1024,12 @@ def api_distinguish_post(post_id, v):
|
|||
|
||||
post = g.db.query(Submission).filter_by(id=post_id).one_or_none()
|
||||
|
||||
if not post:
|
||||
abort(404)
|
||||
if not post: abort(404)
|
||||
|
||||
if not post.author_id == v.id:
|
||||
abort(403)
|
||||
if post.author_id != v.id and v.admin_level < 2 : abort(403)
|
||||
|
||||
if post.distinguish_level:
|
||||
post.distinguish_level = 0
|
||||
else:
|
||||
post.distinguish_level = v.admin_level
|
||||
if post.distinguish_level: post.distinguish_level = 0
|
||||
else: post.distinguish_level = v.admin_level
|
||||
|
||||
g.db.add(post)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue