fix(instructeur): don't display twice pp error on get requests
This commit is contained in:
parent
f50d4948e4
commit
8c6a7a8528
1 changed files with 12 additions and 7 deletions
|
@ -367,15 +367,20 @@ module Instructeurs
|
|||
end
|
||||
|
||||
def procedure_presentation
|
||||
@procedure_presentation ||= get_procedure_presentation
|
||||
end
|
||||
@procedure_presentation ||= begin
|
||||
procedure_presentation, errors = current_instructeur.procedure_presentation_and_errors_for_procedure_id(procedure_id)
|
||||
|
||||
def get_procedure_presentation
|
||||
procedure_presentation, errors = current_instructeur.procedure_presentation_and_errors_for_procedure_id(procedure_id)
|
||||
if errors.present?
|
||||
flash[:alert] = "Votre affichage a dû être réinitialisé en raison du problème suivant : " + errors.full_messages.join(', ')
|
||||
if errors.present?
|
||||
msg = "Votre affichage a dû être réinitialisé en raison du problème suivant : " + errors.full_messages.join(', ')
|
||||
if request.get?
|
||||
flash.now[:alert] = msg
|
||||
else
|
||||
flash[:alert] = msg
|
||||
end
|
||||
end
|
||||
|
||||
procedure_presentation
|
||||
end
|
||||
procedure_presentation
|
||||
end
|
||||
|
||||
def current_filters
|
||||
|
|
Loading…
Reference in a new issue