forked from MarseyWorld/MarseyWorld
no more 500 error
parent
4a1e6cc726
commit
1bce1c273f
|
@ -101,8 +101,9 @@ def remove_report_post(v, pid, uid):
|
|||
uid = int(uid)
|
||||
except: abort(400)
|
||||
|
||||
report = g.db.query(Flag).filter_by(post_id=pid, user_id=uid).one()
|
||||
report = g.db.query(Flag).filter_by(post_id=pid, user_id=uid).one_or_none()
|
||||
|
||||
if report:
|
||||
g.db.delete(report)
|
||||
|
||||
ma=ModAction(
|
||||
|
@ -126,8 +127,9 @@ def remove_report_comment(v, cid, uid):
|
|||
cid = int(cid)
|
||||
uid = int(uid)
|
||||
|
||||
report = g.db.query(CommentFlag).filter_by(comment_id=cid, user_id=uid).one()
|
||||
report = g.db.query(CommentFlag).filter_by(comment_id=cid, user_id=uid).one_or_none()
|
||||
|
||||
if report:
|
||||
g.db.delete(report)
|
||||
|
||||
ma=ModAction(
|
||||
|
|
Loading…
Reference in New Issue