Set reported status when reported and not ignored

This commit is contained in:
Julian Rota 2022-05-23 22:54:53 -04:00
parent 4b6aa40960
commit 16cc7ae6f6

View file

@ -27,6 +27,9 @@ def api_flag_post(pid, v):
else: else:
flag = Flag(post_id=post.id, user_id=v.id, reason=reason) flag = Flag(post_id=post.id, user_id=v.id, reason=reason)
g.db.add(flag) g.db.add(flag)
g.db.query(Submission) \
.where(Submission.id == post.id, Submission.filter_state != 'ignored') \
.update({Submission.filter_state: 'reported'})
g.db.commit() g.db.commit()
@ -62,7 +65,6 @@ def api_flag_comment(cid, v):
return {"message": "Comment reported!"} return {"message": "Comment reported!"}
@app.post('/del_report/comment/<cid>/<uid>') @app.post('/del_report/comment/<cid>/<uid>')
@limiter.limit("1/second;30/minute;200/hour;1000/day") @limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2) @admin_level_required(2)