diff --git a/shared/middleware/files_api.rb b/shared/middleware/files_api.rb index 34e7f15b7073c..6ad090f771de7 100644 --- a/shared/middleware/files_api.rb +++ b/shared/middleware/files_api.rb @@ -856,15 +856,14 @@ def files_put_file(encrypted_channel_id, filename, body) project_type = storage_apps.project_type_from_channel_id(encrypted_channel_id) if MODERATE_THUMBNAILS_FOR_PROJECT_TYPES.include? project_type file_mime_type = mime_type(File.extname(filename.downcase)) - rating = ImageModeration.rate_image(file, file_mime_type, request.fullpath) - if %i(adult racy).include? rating - # Incrementing abuse score by 15 to differentiate from manually reported projects - new_score = storage_apps.increment_abuse(encrypted_channel_id, 15) - FileBucket.new.replace_abuse_score(encrypted_channel_id, s3_prefix, new_score) - response.headers['x-cdo-content-rating'] = rating.to_s - cache_for 1.hour - not_found - end + ImageModeration.rate_image(file, file_mime_type, request.fullpath) + # We are going to re-enable content moderation, but will be adjusting + # the thresholds in a series of trials to optimize for identifying + # inappropriate images without incorrectly flagging appropriate images. + # In the meantime, we don't want to increment abuse score until we + # identify the optimal threshold. + # TODO (ErinB) re-enable abuse score incrementation when + # the correct thresholds are set. end end diff --git a/shared/test/middleware/files_api/test_public_thumbnails.rb b/shared/test/middleware/files_api/test_public_thumbnails.rb index 648017862291d..e9c8712c26087 100644 --- a/shared/test/middleware/files_api/test_public_thumbnails.rb +++ b/shared/test/middleware/files_api/test_public_thumbnails.rb @@ -10,7 +10,9 @@ def setup Aws::S3::Client.expects(:new).never end + #Disabled while we gather Azure moderation stats. (PR 24626)' def test_adult_thumbnail + skip ImageModeration.stubs(:rate_image).once.returns :adult with_project_type('applab') do |channel_id| @@ -38,7 +40,9 @@ def test_adult_thumbnail end end + #Disabled while we gather Azure moderation stats. (PR 24626)' def test_racy_thumbnail + skip ImageModeration.stubs(:rate_image).once.returns :racy with_project_type('applab') do |channel_id|