diff --git a/files/routes/reporting.py b/files/routes/reporting.py index 0c9cf7dc7..98eb16df1 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -27,9 +27,12 @@ def api_flag_post(pid, v): else: flag = Flag(post_id=post.id, user_id=v.id, reason=reason) g.db.add(flag) - g.db.query(Submission) \ - .where(Submission.id == post.id, Submission.filter_state != 'ignored') \ - .update({Submission.filter_state: 'reported'}) + + # We only want to notify if the user is not permabanned + if not v.is_suspended_permanently: + g.db.query(Submission) \ + .where(Submission.id == post.id, Submission.filter_state != 'ignored') \ + .update({Submission.filter_state: 'reported'}) g.db.commit() @@ -46,9 +49,13 @@ def api_flag_comment(cid, v): flag = CommentFlag(comment_id=comment.id, user_id=v.id, reason=reason) g.db.add(flag) - g.db.query(Comment) \ - .where(Comment.id == comment.id, Comment.filter_state != 'ignored') \ - .update({Comment.filter_state: 'reported'}) + + # We only want to notify if the user is not permabanned + if not v.is_suspended_permanently: + g.db.query(Comment) \ + .where(Comment.id == comment.id, Comment.filter_state != 'ignored') \ + .update({Comment.filter_state: 'reported'}) + g.db.commit() return {"message": "Comment reported!"}