Merge pull request #9402 from demarches-simplifiees/fix-archive-upload

corrige bug création archives
This commit is contained in:
mfo 2023-08-19 09:20:44 +00:00 committed by GitHub
commit 770e4e4d1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 10 deletions

View file

@ -77,8 +77,8 @@ GEM
activesupport (= 7.0.5.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activestorage-openstack (1.5.1)
fog-openstack (~> 1.0)
activestorage-openstack (1.6.0)
fog-openstack (>= 1.0.9)
marcel
rails (>= 5.2.2)
activesupport (7.0.5.1)
@ -236,7 +236,7 @@ GEM
tzinfo
ethon (0.15.0)
ffi (>= 1.15.0)
excon (0.79.0)
excon (0.100.0)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
ffi (1.15.5)
@ -254,19 +254,18 @@ GEM
rack (>= 1.4, < 3)
rack-protection (>= 1.5.3, <= 4.0.0)
sanitize (< 7)
fog-core (2.2.3)
fog-core (2.3.0)
builder
excon (~> 0.71)
formatador (~> 0.2)
formatador (>= 0.2, < 2.0)
mime-types
fog-json (1.2.0)
fog-core
multi_json (~> 1.10)
fog-openstack (1.0.11)
fog-openstack (1.1.0)
fog-core (~> 2.1)
fog-json (>= 1.0)
ipaddress (>= 0.8)
formatador (0.2.5)
formatador (1.1.0)
fugit (1.4.2)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4)
@ -349,7 +348,6 @@ GEM
ruby-vips (>= 2.0.17, < 3)
invisible_captcha (2.0.0)
rails (>= 5.0)
ipaddress (0.8.3)
jquery-rails (4.5.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)

View file

@ -13,6 +13,7 @@ class ArchiveUploader
archive.file.detach
end
archive.reload
uploaded_blob.reload
ActiveStorage::Attachment.create(
name: 'file',
record_type: 'Archive',
@ -68,7 +69,7 @@ class ArchiveUploader
key: namespaced_object_key,
filename: filename,
content_type: 'application/zip',
metadata: { virus_scan_result: ActiveStorage::VirusScanner::SAFE }
metadata: { analyzed: true, virus_scan_result: ActiveStorage::VirusScanner::SAFE }
}
end