fix(instructeur): don't crash when adding a filter too long

This commit is contained in:
Colin Darie 2024-02-21 12:13:47 +01:00
parent 5a8859cd28
commit 5ab1d45b8a
3 changed files with 29 additions and 7 deletions

View file

@ -148,7 +148,9 @@ module Instructeurs
end
def add_filter
procedure_presentation.add_filter(statut, params[:field], params[:value])
if !procedure_presentation.add_filter(statut, params[:field], params[:value])
flash.alert = procedure_presentation.errors.full_messages
end
redirect_back(fallback_location: instructeur_procedure_url(procedure))
end