Merge branch 'develop' into develop_v2

This commit is contained in:
Xavier J 2016-12-13 14:26:00 +01:00
commit dff90d2cf7

View file

@ -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?