Merge pull request #7971 from demarches-simplifiees/ignore_integrity_error_on_clone

fix(clone): lors du clone d'une procédure, ignore les fichiers corrompus
This commit is contained in:
LeSim 2022-11-01 10:31:31 +01:00 committed by GitHub
commit a2a9a9aec0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -479,7 +479,7 @@ class Procedure < ApplicationRecord
procedure = self.deep_clone(include: include_list) do |original, kopy|
begin
PiecesJustificativesService.clone_attachments(original, kopy)
rescue ActiveStorage::FileNotFoundError
rescue ActiveStorage::FileNotFoundError, ActiveStorage::IntegrityError
end
end
procedure.path = SecureRandom.uuid