Suppress reports created by shadowbanned users.

This commit is contained in:
Ben Rog-Wilhelm 2024-08-08 07:45:48 -05:00
parent 8fbd3cdfea
commit 208f9974f9

View file

@ -52,7 +52,8 @@ def api_flag_comment(cid, v):
g.db.add(flag) g.db.add(flag)
# We only want to notify if the user is not permabanned # We only want to notify if the user is not permabanned
if not v.is_suspended_permanently: # this should probably be a "reportbanned" flag that's applied manually that also clears their reports, but that's a lot more work
if not v.is_suspended_permanently and not v.shadowbanned:
g.db.query(Comment) \ g.db.query(Comment) \
.where(Comment.id == comment.id, Comment.state_report != StateReport.IGNORED) \ .where(Comment.id == comment.id, Comment.state_report != StateReport.IGNORED) \
.update({Comment.state_report: StateReport.REPORTED}) .update({Comment.state_report: StateReport.REPORTED})