[#1209] Make sure date de dépôt is available before sending mail

This commit is contained in:
Frederic Merizen 2018-01-10 17:46:41 +01:00
parent bcf3246e89
commit 32be8213da

View file

@ -53,8 +53,9 @@ class Users::DescriptionController < UsersController
redirect_to url_for(controller: :dossiers, action: :index, liste: :brouillon)
else
if dossier.brouillon?
NotificationMailer.send_notification(dossier, procedure.initiated_mail_template).deliver_now!
dossier.en_construction!
# TODO move to model
NotificationMailer.send_notification(dossier, procedure.initiated_mail_template).deliver_now!
end
flash.notice = 'Félicitations, votre demande a bien été enregistrée.'
redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: dossier.id)