Merge pull request #7827 from E-L-T/7807-fix-etq-admin-ne-pas-activer-routage-sans-groupe
7807 fix améliore la validation sur le libellé de routage
This commit is contained in:
commit
8f2d0168e5
2 changed files with 7 additions and 4 deletions
|
@ -191,10 +191,12 @@ module Administrateurs
|
|||
end
|
||||
|
||||
def update_routing_criteria_name
|
||||
procedure.update!(routing_criteria_name: routing_criteria_name)
|
||||
|
||||
redirect_to admin_procedure_groupe_instructeurs_path(procedure),
|
||||
notice: "Le libellé est maintenant « #{procedure.routing_criteria_name} »."
|
||||
if procedure.update(routing_criteria_name: routing_criteria_name)
|
||||
flash[:notice] = "Le libellé est maintenant « #{procedure.routing_criteria_name} »."
|
||||
else
|
||||
flash[:alert] = "Le libellé du routage doit être rempli."
|
||||
end
|
||||
redirect_to admin_procedure_groupe_instructeurs_path(procedure)
|
||||
end
|
||||
|
||||
def update_routing_enabled
|
||||
|
|
|
@ -323,6 +323,7 @@ class Procedure < ApplicationRecord
|
|||
|
||||
validates :api_entreprise_token, jwt_token: true, allow_blank: true
|
||||
validates :api_particulier_token, format: { with: /\A[A-Za-z0-9\-_=.]{15,}\z/ }, allow_blank: true
|
||||
validates :routing_criteria_name, presence: true, allow_blank: false
|
||||
|
||||
before_save :update_juridique_required
|
||||
after_initialize :ensure_path_exists
|
||||
|
|
Loading…
Reference in a new issue