diff --git a/app/controllers/new_gestionnaire/procedures_controller.rb b/app/controllers/new_gestionnaire/procedures_controller.rb index dad304e23..81f36b586 100644 --- a/app/controllers/new_gestionnaire/procedures_controller.rb +++ b/app/controllers/new_gestionnaire/procedures_controller.rb @@ -237,9 +237,10 @@ module NewGestionnaire when 'user', 'etablissement', 'entreprise' if filter['column'] == 'date_creation' + date = filter['value'].to_date rescue nil dossiers .includes(filter['table']) - .where("#{filter['table'].pluralize}.#{filter['column']} = ?", filter['value'].to_date) + .where("#{filter['table'].pluralize}.#{filter['column']} = ?", date) else dossiers .includes(filter['table']) diff --git a/app/lib/flipflop/strategies/user_preference_strategy.rb b/app/lib/flipflop/strategies/user_preference_strategy.rb index 3766e6a93..c4b0824d2 100644 --- a/app/lib/flipflop/strategies/user_preference_strategy.rb +++ b/app/lib/flipflop/strategies/user_preference_strategy.rb @@ -35,8 +35,8 @@ module Flipflop::Strategies end def find_current_administrateur - if request.session["warden.user.user.key"] - administrateur_id = request.session["warden.user.user.key"][0][0] + if request.session["warden.user.administrateur.key"] + administrateur_id = request.session["warden.user.administrateur.key"][0][0] Administrateur.find_by(id: administrateur_id) end end