forked from rDrama/rDrama
1
0
Fork 0

disallow permanently banned users from untoggling NSFW

can help i guess prevent abuse and creating a situation where dueling NSFW toggles have to be set
master
justcool393 2022-10-04 14:09:25 -07:00 committed by GitHub
parent 43a33b1359
commit d5bd3463e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -1112,6 +1112,9 @@ def toggle_comment_nsfw(cid, v):
if comment.author_id != v.id and not v.admin_level > 1 and not (comment.post.sub and v.mods(comment.post.sub)):
abort(403)
if comment.over_18 and v.is_suspended_permanently:
abort(403)
comment.over_18 = not comment.over_18
g.db.add(comment)
@ -1134,6 +1137,9 @@ def toggle_post_nsfw(pid, v):
if post.author_id != v.id and not v.admin_level > 1 and not (post.sub and v.mods(post.sub)):
abort(403)
if post.over_18 and v.is_suspended_permanently:
abort(403)
post.over_18 = not post.over_18
g.db.add(post)