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,16 +367,21 @@ module Instructeurs
|
|||
end
|
||||
|
||||
def procedure_presentation
|
||||
@procedure_presentation ||= get_procedure_presentation
|
||||
@procedure_presentation ||= begin
|
||||
procedure_presentation, errors = current_instructeur.procedure_presentation_and_errors_for_procedure_id(procedure_id)
|
||||
|
||||
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
|
||||
|
||||
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(', ')
|
||||
end
|
||||
procedure_presentation
|
||||
end
|
||||
end
|
||||
|
||||
def current_filters
|
||||
@current_filters ||= procedure_presentation.filters.fetch(statut, [])
|
||||
|
|
Loading…
Reference in a new issue