Merge pull request #4921 from betagouv/fix/4872

fix/4872  - fix the email notifications data bug
This commit is contained in:
Kara Diaby 2020-03-20 18:11:02 +01:00 committed by GitHub
commit 8d75722392
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,11 +163,13 @@ class Instructeur < ApplicationRecord
acc << h
end
[["en_instruction", h[:nb_en_instruction]], ["accepte", h[:nb_accepted]]].each do |state, count|
if procedure.declarative_with_state == state && count > 0
h[:procedure_id] = procedure.id
h[:procedure_libelle] = procedure.libelle
acc << h
if h[:nb_en_instruction] > 0 || h[:nb_accepted] > 0
[["en_instruction", h[:nb_en_instruction]], ["accepte", h[:nb_accepted]]].each do |state, count|
if procedure&.declarative_with_state == state && count > 0
h[:procedure_id] = procedure.id
h[:procedure_libelle] = procedure.libelle
acc << h
end
end
end