Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider e8964857 rédigé par Eugen Rochko's avatar Eugen Rochko Validation de GitHub
Parcourir les fichiers

Fix error when changing ACL on missing objects during suspension (#15420)

parent ba0b79fc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -70,7 +70,11 @@ class SuspendAccountService < BaseService ...@@ -70,7 +70,11 @@ class SuspendAccountService < BaseService
styles.each do |style| styles.each do |style|
case Paperclip::Attachment.default_options[:storage] case Paperclip::Attachment.default_options[:storage]
when :s3 when :s3
attachment.s3_object(style).acl.put(acl: 'private') begin
attachment.s3_object(style).acl.put(acl: 'private')
rescue Aws::S3::Errors::NoSuchKey
Rails.logger.warn "Tried to change acl on non-existent key #{attachment.s3_object(style).key}"
end
when :fog when :fog
# Not supported # Not supported
when :filesystem when :filesystem
......
...@@ -61,7 +61,11 @@ class UnsuspendAccountService < BaseService ...@@ -61,7 +61,11 @@ class UnsuspendAccountService < BaseService
styles.each do |style| styles.each do |style|
case Paperclip::Attachment.default_options[:storage] case Paperclip::Attachment.default_options[:storage]
when :s3 when :s3
attachment.s3_object(style).acl.put(acl: Paperclip::Attachment.default_options[:s3_permissions]) begin
attachment.s3_object(style).acl.put(acl: Paperclip::Attachment.default_options[:s3_permissions])
rescue Aws::S3::Errors::NoSuchKey
Rails.logger.warn "Tried to change acl on non-existent key #{attachment.s3_object(style).key}"
end
when :fog when :fog
# Not supported # Not supported
when :filesystem when :filesystem
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter