Merge pull request #1210 from betagouv/fix_1209-date_de_depot_in_received_mail

[#1209] Make sure date de dépôt is available before sending mail
This commit is contained in:
LeSim 2018-01-10 18:42:19 +01:00 committed by GitHub
commit 49d5f276ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)