EQT instructeur, je peux supprimer un dossier terminé

This commit is contained in:
kara Diaby 2020-11-17 13:25:35 +01:00 committed by simon lehericey
parent f7f832bed8
commit 00b5ad7a10
18 changed files with 255 additions and 97 deletions

View file

@ -214,6 +214,17 @@ module Instructeurs
zipline(files, "dossier-#{dossier.id}.zip")
end
def delete_dossier
if dossier.termine?
dossier.deleted_by_instructeur_and_keep_track!(current_instructeur)
flash.notice = 'Le dossier a bien été supprimé'
redirect_to instructeur_procedure_path(procedure)
else
flash.alert = "Suppression impossible : le dossier n'est pas terminé"
redirect_back(fallback_location: instructeur_procedures_url)
end
end
private
def dossier