Merge branch 'develop' into develop_v2
This commit is contained in:
commit
dff90d2cf7
1 changed files with 4 additions and 2 deletions
|
@ -6,8 +6,10 @@ class InvitesController < ApplicationController
|
||||||
|
|
||||||
class_var = @current_devise_profil.class == User ? InviteUser : InviteGestionnaire
|
class_var = @current_devise_profil.class == User ? InviteUser : InviteGestionnaire
|
||||||
|
|
||||||
user = User.find_by_email(params[:email])
|
email = params[:email].downcase
|
||||||
invite = class_var.create(dossier_id: params[:dossier_id], user: user, email: params[:email].downcase, email_sender: email_sender)
|
|
||||||
|
user = User.find_by_email(email)
|
||||||
|
invite = class_var.create(dossier_id: params[:dossier_id], user: user, email: email, email_sender: email_sender)
|
||||||
|
|
||||||
if invite.valid?
|
if invite.valid?
|
||||||
InviteMailer.invite_user(invite).deliver_now! unless invite.user.nil?
|
InviteMailer.invite_user(invite).deliver_now! unless invite.user.nil?
|
||||||
|
|
Loading…
Reference in a new issue