posts: change safe mode to only allow rating:g posts.

This commit is contained in:
evazion
2022-06-06 00:56:52 -05:00
parent ca289d869c
commit 4364516f2b
2 changed files with 2 additions and 2 deletions

View File

@@ -198,7 +198,7 @@ class PostQuery
return [] unless safe_mode?
tags = Danbooru.config.safe_mode_restricted_tags.map { |tag| -AST.tag(tag) }
[AST.metatag("rating", "g,s"), *tags]
[AST.metatag("rating", "g"), *tags]
end
# XXX unify with PostSets::Post#show_deleted?

View File

@@ -1570,7 +1570,7 @@ class Post < ApplicationRecord
end
def safeblocked?
CurrentUser.safe_mode? && (rating.in?(["q", "e"]) || Danbooru.config.safe_mode_restricted_tags.any? { |tag| tag.in?(tag_array) })
CurrentUser.safe_mode? && (rating != "g" || Danbooru.config.safe_mode_restricted_tags.any? { |tag| tag.in?(tag_array) })
end
def levelblocked?(user = CurrentUser.user)