fix(accuse-lecture): don't crash on dossier acceptance when procedure is still draft
This commit is contained in:
parent
b74319b3ee
commit
2d57ec4056
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ class MailTemplatePresenterService
|
|||
|
||||
def self.create_commentaire_for_state(dossier, state)
|
||||
if dossier.procedure.accuse_lecture? && Dossier::TERMINE.include?(state)
|
||||
CommentaireService.create!(CONTACT_EMAIL, dossier, body: I18n.t('layouts.mailers.accuse_lecture.commentaire_html', service: dossier.procedure.service.nom))
|
||||
CommentaireService.create!(CONTACT_EMAIL, dossier, body: I18n.t('layouts.mailers.accuse_lecture.commentaire_html', service: dossier.procedure.service&.nom))
|
||||
else
|
||||
service = new(dossier, state)
|
||||
body = ["<p>[#{service.safe_subject}]</p>", service.safe_body].join('')
|
||||
|
|
Loading…
Reference in a new issue