Skip to content

Commit 8bbf8fe

Browse files
committed
use content_moderation_disabled to determine if we should moderate a given thumbnail
1 parent b07bda8 commit 8bbf8fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared/middleware/files_api.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,8 @@ def files_put_file(encrypted_channel_id, filename, body)
855855
if THUMBNAIL_FILENAME == filename
856856
storage_apps = StorageApps.new(storage_id('user'))
857857
project_type = storage_apps.project_type_from_channel_id(encrypted_channel_id)
858-
if MODERATE_THUMBNAILS_FOR_PROJECT_TYPES.include? project_type
858+
content_moderation_enabled = !storage_apps.content_moderation_disabled?(encrypted_channel_id)
859+
if MODERATE_THUMBNAILS_FOR_PROJECT_TYPES.include?(project_type) && content_moderation_enabled
859860
file_mime_type = mime_type(File.extname(filename.downcase))
860861
rating = ImageModeration.rate_image(file, file_mime_type, request.fullpath)
861862
if %i(adult racy).include? rating

0 commit comments

Comments
 (0)