Skip to content

Commit bb58730

Browse files
authored
Merge pull request code-dot-org#24869 from code-dot-org/skip-auto-content-mod
Image Moderation: functional disable automated moderation buttons
2 parents f8ca3c0 + 8bbf8fe commit bb58730

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

apps/src/code-studio/showProjectAdmin.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,13 @@ export default () => {
8484

8585
$('#disable-auto-moderation').click(async function () {
8686
await dashboard.project.disableAutoContentModeration();
87-
alert("Our moderation filter is currently turned off for all projects, but your choice will be saved and applied when we re-enable the moderation service.");
8887
$('#disable-auto-moderation').hide();
8988
$('#moderation-explanation').hide();
9089
$('#enable-auto-moderation').show();
9190
});
9291

9392
$('#enable-auto-moderation').click(async function () {
9493
await dashboard.project.enableAutoContentModeration();
95-
alert("Our moderation filter is currently turned off for all projects, but your choice will be saved and applied when we re-enable the moderation service.");
9694
$('#disable-auto-moderation').show();
9795
$('#moderation-explanation').show();
9896
$('#enable-auto-moderation').hide();

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)