about summary refs log tree commit diff
path: root/app/services/suspend_account_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-12-24 15:53:45 +0100
committerGitHub <noreply@github.com>2020-12-24 15:53:45 +0100
commite89648574f20f24c3e3e8dafeefe5bcca7348ea5 (patch)
tree1b7f5b9af7c5f455d0ef992305f337828f0a61d0 /app/services/suspend_account_service.rb
parentba0b79fc5c698b3d2ca4849bc3a711c75bd76d22 (diff)
Fix error when changing ACL on missing objects during suspension (#15420)
Diffstat (limited to 'app/services/suspend_account_service.rb')
-rw-r--r--app/services/suspend_account_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb
index 22e519708..9f4da91d4 100644
--- a/app/services/suspend_account_service.rb
+++ b/app/services/suspend_account_service.rb
@@ -70,7 +70,11 @@ class SuspendAccountService < BaseService
         styles.each do |style|
           case Paperclip::Attachment.default_options[:storage]
           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
             # Not supported
           when :filesystem