FIX: don't disable download_remote_images_to_local if site uses S3 (#7861)

This commit is contained in:
Osama Sayegh 2019-07-05 06:36:03 +03:00 committed by Sam
parent b9a2a4d904
commit 65a6f3080e
2 changed files with 9 additions and 0 deletions

View File

@ -642,6 +642,7 @@ class CookedPostProcessor
def disable_if_low_on_disk_space
return false if !SiteSetting.download_remote_images_to_local
return false if available_disk_space >= SiteSetting.download_remote_images_threshold
return false if Discourse.store.external?
SiteSetting.download_remote_images_to_local = false
# log the site setting change

View File

@ -1158,6 +1158,14 @@ describe CookedPostProcessor do
expect(SiteSetting.download_remote_images_to_local).to eq(false)
end
it "doesn't disable download_remote_images_to_local if site uses S3" do
SiteSetting.s3_access_key_id = "s3-access-key-id"
SiteSetting.s3_secret_access_key = "s3-secret-access-key"
SiteSetting.enable_s3_uploads = true
expect(cpp.disable_if_low_on_disk_space).to eq(false)
expect(SiteSetting.download_remote_images_to_local).to eq(true)
end
end
end