diff --git a/app/models/dossier.rb b/app/models/dossier.rb index fce3f381f..3a9d86f2a 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -382,7 +382,7 @@ class Dossier < ApplicationRecord validates :groupe_instructeur, presence: true, if: -> { !brouillon? } def user_deleted? - user_id.nil? + persisted? && user_id.nil? end def user_email_for(use) diff --git a/app/views/dossier_mailer/notify_new_answer.html.haml b/app/views/dossier_mailer/notify_new_answer.html.haml index 28f26ca6f..6b05e9455 100644 --- a/app/views/dossier_mailer/notify_new_answer.html.haml +++ b/app/views/dossier_mailer/notify_new_answer.html.haml @@ -4,11 +4,11 @@ %p= t(:hello, scope: [:views, :shared, :greetings]) - if !@dossier.brouillon? - %p= t('.body', libelle_demarche: @dossier.procedure.libelle) + %p= t('.body_html', libelle_demarche: @dossier.procedure.libelle) %p= t('.link') = round_button(t('.access_message'), messagerie_dossier_url(@dossier), :primary) - else - %p= t('.body_draft', libelle_demarche: @dossier.procedure.libelle) + %p= t('.body_draft_html', libelle_demarche: @dossier.procedure.libelle) %p{ style: "padding: 8px; color: #333333; background-color: #EEEEEE; font-size: 14px;" } = @body %p= t('.contact') diff --git a/app/views/dossier_mailer/notify_new_draft.html.haml b/app/views/dossier_mailer/notify_new_draft.html.haml index ee0219970..cc449fcce 100644 --- a/app/views/dossier_mailer/notify_new_draft.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.html.haml @@ -3,8 +3,8 @@ %p= t(:hello, scope: [:views, :shared, :greetings]) -%p= t('.body', libelle_demarche: @dossier.procedure.libelle) -%p= t('.link') +%p= t('.body_html', libelle_demarche: @dossier.procedure.libelle) +%p= t('.link_html') = round_button(t('.access_file'), dossier_url(@dossier), :primary) - if @dossier.procedure.auto_archive_on diff --git a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml index e8323b95c..fad3671c0 100644 --- a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml +++ b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml @@ -4,7 +4,7 @@ %p= t(:hello, scope: [:views, :shared, :greetings]) %p - = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) + = t('.body_html', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) = link_to dossier_url(@dossier), dossier_url(@dossier), target: '_blank', rel: 'noopener' - if @dossier.procedure.service.present? %p