posts: change safe mode to only allow rating:g posts.
This commit is contained in:
@@ -198,7 +198,7 @@ class PostQuery
|
|||||||
return [] unless safe_mode?
|
return [] unless safe_mode?
|
||||||
|
|
||||||
tags = Danbooru.config.safe_mode_restricted_tags.map { |tag| -AST.tag(tag) }
|
tags = Danbooru.config.safe_mode_restricted_tags.map { |tag| -AST.tag(tag) }
|
||||||
[AST.metatag("rating", "g,s"), *tags]
|
[AST.metatag("rating", "g"), *tags]
|
||||||
end
|
end
|
||||||
|
|
||||||
# XXX unify with PostSets::Post#show_deleted?
|
# XXX unify with PostSets::Post#show_deleted?
|
||||||
|
|||||||
@@ -1570,7 +1570,7 @@ class Post < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def safeblocked?
|
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
|
end
|
||||||
|
|
||||||
def levelblocked?(user = CurrentUser.user)
|
def levelblocked?(user = CurrentUser.user)
|
||||||
|
|||||||
Reference in New Issue
Block a user