[fix #3440] use attachment.download for get attachment file
This commit is contained in:
parent
5fadaaca14
commit
c0a928ac7a
1 changed files with 4 additions and 7 deletions
|
@ -454,15 +454,12 @@ class Procedure < ApplicationRecord
|
|||
def clone_attachment(cloned_procedure, attachment_symbol)
|
||||
attachment = send(attachment_symbol)
|
||||
if attachment.attached?
|
||||
response = Typhoeus.get(attachment.service_url, timeout: 5)
|
||||
if response.success?
|
||||
cloned_procedure.send(attachment_symbol).attach(
|
||||
io: StringIO.new(response.body),
|
||||
io: StringIO.new(attachment.download),
|
||||
filename: attachment.filename
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_juridique
|
||||
if juridique_required? && (cadre_juridique.blank? && !deliberation.attached?)
|
||||
|
|
Loading…
Reference in a new issue