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
|
end
|
||||||
|
|
||||||
def procedure_presentation
|
def procedure_presentation
|
||||||
@procedure_presentation ||= get_procedure_presentation
|
@procedure_presentation ||= begin
|
||||||
end
|
procedure_presentation, errors = current_instructeur.procedure_presentation_and_errors_for_procedure_id(procedure_id)
|
||||||
|
|
||||||
def get_procedure_presentation
|
if errors.present?
|
||||||
procedure_presentation, errors = current_instructeur.procedure_presentation_and_errors_for_procedure_id(procedure_id)
|
msg = "Votre affichage a dû être réinitialisé en raison du problème suivant : " + errors.full_messages.join(', ')
|
||||||
if errors.present?
|
if request.get?
|
||||||
flash[:alert] = "Votre affichage a dû être réinitialisé en raison du problème suivant : " + errors.full_messages.join(', ')
|
flash.now[:alert] = msg
|
||||||
|
else
|
||||||
|
flash[:alert] = msg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
procedure_presentation
|
||||||
end
|
end
|
||||||
procedure_presentation
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_filters
|
def current_filters
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue