Merge pull request #3073 from betagouv/fix-sentry-26
[Fix sentry-26] if file does not exist, filename should be nil
This commit is contained in:
commit
489cf7c855
1 changed files with 8 additions and 6 deletions
|
@ -25,6 +25,7 @@ class ProcedureLogoUploader < BaseUploader
|
||||||
end
|
end
|
||||||
|
|
||||||
def filename
|
def filename
|
||||||
|
if file.present?
|
||||||
if original_filename.present? || model.logo_secure_token
|
if original_filename.present? || model.logo_secure_token
|
||||||
if Flipflop.remote_storage?
|
if Flipflop.remote_storage?
|
||||||
filename = "#{model.class.to_s.underscore}-#{secure_token}.#{file.extension.downcase}"
|
filename = "#{model.class.to_s.underscore}-#{secure_token}.#{file.extension.downcase}"
|
||||||
|
@ -34,6 +35,7 @@ class ProcedureLogoUploader < BaseUploader
|
||||||
end
|
end
|
||||||
filename
|
filename
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue