instructeurs: fix email casing in invitation

When inviting an instructeur, the code first looked up an existing
instructeur using the normalized (downcased) email address–but then
tried to promote it using the non-normalized version, which failed.

This fixes the issue by always using the normalized email.
This commit is contained in:
Pierre de La Morinerie 2019-11-04 18:32:56 +01:00 committed by simon lehericey
parent 1adda1b405
commit c37bfc7349

View file

@ -15,7 +15,7 @@ class Admin::InstructeursController < AdminController
procedure_id = params[:procedure_id]
if @instructeur.nil?
invite_instructeur(params[:instructeur][:email])
invite_instructeur(email)
else
assign_instructeur!
end