Skip to content
Snippets Groups Projects
Commit c4c79f5a authored by Serge Ahranovich's avatar Serge Ahranovich
Browse files

Merge pull request #23 from zumbrunnen/zumbrunnen-redmine-3x-fix

Fixes NoMethodError with Redmine 3.x
parents 6b2deedb 8f4e3811
Branches master
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ class RedmineOauthController < AccountController
def try_to_login info
params[:back_url] = session[:back_url]
session.delete(:back_url)
user = User.find_or_initialize_by_mail(info["email"])
user = User.joins(:email_addresses).where(:email_addresses => { :address => info["email"] }).first_or_create
if user.new_record?
# Self-registration off
redirect_to(home_url) && return unless Setting.self_registration?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment