Merge pull request #9043 from tchak/fix-after-party-task

fix(after_party): do not crash if missing champs for dossier
This commit is contained in:
Paul Chavard 2023-05-12 21:27:45 +02:00 committed by GitHub
commit 13fdaec2c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ namespace :after_party do
.group_by(&:first).transform_values { _1.map(&:second) }
bad_dossiers = dossiers.filter do |(id, revision_id)|
champs_by_dossier_id[id].any? do |type_de_champ_id|
(champs_by_dossier_id[id] || []).any? do |type_de_champ_id|
revision_ids = revisions_by_type_de_champ_id[type_de_champ_id] || []
!revision_id.in?(revision_ids)
end