diff --git a/app/controllers/new_user/dossiers_controller.rb b/app/controllers/new_user/dossiers_controller.rb index ce5023b9f..7f8091f5b 100644 --- a/app/controllers/new_user/dossiers_controller.rb +++ b/app/controllers/new_user/dossiers_controller.rb @@ -122,14 +122,14 @@ module NewUser flash.now.alert = errors render :modifier else - if current_user.owns?(dossier) - if Flipflop.new_dossier_details? - redirect_to demande_dossier_path(@dossier) - else - redirect_to users_dossier_recapitulatif_path(@dossier) - end + if Flipflop.new_dossier_details? + redirect_to demande_dossier_path(@dossier) else - redirect_to users_dossiers_invite_path(@dossier.invite_for_user(current_user)) + if current_user.owns?(dossier) + redirect_to users_dossier_recapitulatif_path(@dossier) + else + redirect_to users_dossiers_invite_path(@dossier.invite_for_user(current_user)) + end end end end diff --git a/app/controllers/users/dossiers/invites_controller.rb b/app/controllers/users/dossiers/invites_controller.rb index f4c4d9dc6..078e3d74c 100644 --- a/app/controllers/users/dossiers/invites_controller.rb +++ b/app/controllers/users/dossiers/invites_controller.rb @@ -12,6 +12,10 @@ class Users::Dossiers::InvitesController < UsersController def show @facade = InviteDossierFacades.new params[:id].to_i, current_user.email + if Flipflop.new_dossier_details? + return redirect_to dossier_path(@facade.dossier) + end + if @facade.dossier.brouillon? redirect_to brouillon_dossier_path(@facade.dossier) else