fix(dossier): redirect on not found dossiers
This commit is contained in:
parent
ad5c659f88
commit
2eb7da5227
1 changed files with 7 additions and 0 deletions
|
@ -8,6 +8,7 @@ module Instructeurs
|
|||
include ActionController::Streaming
|
||||
include Zipline
|
||||
|
||||
before_action :redirect_on_dossier_not_found, only: :show
|
||||
after_action :mark_demande_as_read, only: :show
|
||||
after_action :mark_messagerie_as_read, only: [:messagerie, :create_commentaire]
|
||||
after_action :mark_avis_as_read, only: [:avis, :create_avis]
|
||||
|
@ -301,5 +302,11 @@ module Instructeurs
|
|||
"Le dossier est en ce moment #{dossier_display_state(exception.originating_state, lower: true)} : il n’est pas possible de le passer #{dossier_display_state(target_state, lower: true)}."
|
||||
end
|
||||
end
|
||||
|
||||
def redirect_on_dossier_not_found
|
||||
if !current_instructeur.dossiers.visible_by_administration.exists?(id: params[:dossier_id])
|
||||
redirect_to instructeur_procedure_path(procedure)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue