[Fix sentry-26] if file does not exist, filename should be nil

This commit is contained in:
Mathieu Magnin 2018-11-27 14:02:29 +01:00
parent b53d7d5fef
commit 91115ea847

View file

@ -25,6 +25,7 @@ class ProcedureLogoUploader < BaseUploader
end
def filename
if file.present?
if original_filename.present? || model.logo_secure_token
if Flipflop.remote_storage?
filename = "#{model.class.to_s.underscore}-#{secure_token}.#{file.extension.downcase}"
@ -34,6 +35,7 @@ class ProcedureLogoUploader < BaseUploader
end
filename
end
end
private