fix(groupe_instructeur): always use assign_to_groupe_instructeur method
This commit is contained in:
parent
08a2a2c9aa
commit
71cfe094aa
6 changed files with 19 additions and 20 deletions
|
@ -174,6 +174,7 @@ module Users
|
|||
errors = submit_dossier_and_compute_errors
|
||||
|
||||
if errors.blank?
|
||||
RoutingEngine.compute(@dossier)
|
||||
@dossier.passer_en_construction!
|
||||
@dossier.process_declarative!
|
||||
NotificationMailer.send_en_construction_notification(@dossier).deliver_later
|
||||
|
@ -210,6 +211,8 @@ module Users
|
|||
if errors.blank?
|
||||
editing_fork_origin = @dossier.editing_fork_origin
|
||||
editing_fork_origin.merge_fork(@dossier)
|
||||
RoutingEngine.compute(editing_fork_origin)
|
||||
|
||||
redirect_to dossier_path(editing_fork_origin)
|
||||
else
|
||||
flash.now.alert = errors
|
||||
|
@ -493,10 +496,6 @@ module Users
|
|||
@dossier.assign_to_groupe_instructeur(groupe_instructeur_from_params)
|
||||
end
|
||||
|
||||
if @dossier.procedure.feature_enabled?(:routing_rules)
|
||||
RoutingEngine.compute(@dossier)
|
||||
end
|
||||
|
||||
errors
|
||||
end
|
||||
|
||||
|
@ -511,7 +510,7 @@ module Users
|
|||
@dossier.assign_to_groupe_instructeur(defaut_groupe_instructeur)
|
||||
end
|
||||
|
||||
if @dossier.groupe_instructeur.nil?
|
||||
if !@dossier.procedure.feature_enabled?(:routing_rules) && @dossier.groupe_instructeur.nil?
|
||||
errors += format_errors(errors: ["Le champ « #{@dossier.procedure.routing_criteria_name} » doit être rempli"])
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue