no more 500 error

master
Aevann1 2022-06-07 12:32:48 +02:00
parent 4a1e6cc726
commit 1bce1c273f
1 changed files with 21 additions and 19 deletions

View File

@ -101,8 +101,9 @@ def remove_report_post(v, pid, uid):
uid = int(uid) uid = int(uid)
except: abort(400) 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) g.db.delete(report)
ma=ModAction( ma=ModAction(
@ -126,8 +127,9 @@ def remove_report_comment(v, cid, uid):
cid = int(cid) cid = int(cid)
uid = int(uid) 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) g.db.delete(report)
ma=ModAction( ma=ModAction(