Same for go back in instruction

This commit is contained in:
simon lehericey 2019-07-11 11:52:24 +02:00
parent 5f39d3eac8
commit 768a298c2d
2 changed files with 30 additions and 2 deletions

View file

@ -103,8 +103,12 @@ module Gestionnaires
end
def repasser_en_instruction
flash.notice = "Le dossier #{dossier.id} a été repassé en instruction."
dossier.repasser_en_instruction!(current_gestionnaire)
if dossier.en_instruction?
flash.notice = 'Le dossier est déjà en instruction.'
else
flash.notice = "Le dossier #{dossier.id} a été repassé en instruction."
dossier.repasser_en_instruction!(current_gestionnaire)
end
render partial: 'state_button_refresh', locals: { dossier: dossier }
end