Commit e7897079 authored by hh1966's avatar hh1966
Browse files

Use identifier for attachments export

parent 53157f8c
Pipeline #45277 failed with stage
......@@ -61,7 +61,7 @@ module Export
# write all attachemnts into an attachments directory
@attachments.each do |attachment|
attachment_path = File.join('attachments', attachment.filename)
attachment_path = File.join('attachments', attachment.identifier)
zip.put_next_entry attachment_path
zip.write attachment.read_file
description += "#{attachment.checksum} #{attachment_path}\n"
......
......@@ -360,7 +360,7 @@ module Import
attachable = @instances.fetch(attachable_type).fetch(attachable_uuid)
# construct file path
file_path = File.join(@directory, 'attachments', fields.fetch('filename'))
file_path = File.join(@directory, 'attachments', fields.fetch('identifier'))
# create the attachment
attachment = attachable.attachments.create!(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment