From b3c5fcb4c585a015e2ecc6135f6521681f00619f Mon Sep 17 00:00:00 2001 From: kara Diaby Date: Tue, 8 Jun 2021 17:55:38 +0200 Subject: [PATCH] fix procedure not found --- app/controllers/users/statistiques_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/users/statistiques_controller.rb b/app/controllers/users/statistiques_controller.rb index 456a93572..8b1611027 100644 --- a/app/controllers/users/statistiques_controller.rb +++ b/app/controllers/users/statistiques_controller.rb @@ -17,5 +17,15 @@ module Users def procedure Procedure.publiees.or(Procedure.brouillons).find_by(path: params[:path]) end + + def procedure_not_found + if procedure&.close? + flash.alert = t('errors.messages.procedure_archived') + else + flash.alert = t('errors.messages.procedure_not_found') + end + + redirect_to root_path + end end end