Update for readability
fixed a test a broke in the configurable theme PR Change-Id: Id894506941bc01ab0d259d48ca7ff9b80bb2c57e
This commit is contained in:
parent
75b2ff8f43
commit
8a8123a3d4
|
@ -44,11 +44,15 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_user(email)
|
def find_user(email)
|
||||||
if user = model.find_by_email(email)
|
user = model.find_by_email(email)
|
||||||
elsif ldap_conf['allow_username_or_email_login']
|
|
||||||
uname = (email.partition('@').first) unless email.nil?
|
# If no user found and allow_username_or_email_login is true
|
||||||
|
# we look for user by extracting part of his email
|
||||||
|
if !user && email && ldap_conf['allow_username_or_email_login']
|
||||||
|
uname = email.partition('@').first
|
||||||
user = model.find_by_username(uname)
|
user = model.find_by_username(uname)
|
||||||
end
|
end
|
||||||
|
|
||||||
user
|
user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ describe User do
|
||||||
it "should apply defaults to user" do
|
it "should apply defaults to user" do
|
||||||
Gitlab.config.gitlab.default_projects_limit.should_not == 123
|
Gitlab.config.gitlab.default_projects_limit.should_not == 123
|
||||||
Gitlab.config.gitlab.default_can_create_group.should_not be_true
|
Gitlab.config.gitlab.default_can_create_group.should_not be_true
|
||||||
Gitlab.config.gitlab.default_theme.should_not == Gitlab::Theme::MARS
|
Gitlab.config.gitlab.default_theme.should_not == Gitlab::Theme::BASIC
|
||||||
user.projects_limit.should == 123
|
user.projects_limit.should == 123
|
||||||
user.can_create_group.should be_true
|
user.can_create_group.should be_true
|
||||||
user.theme_id.should == Gitlab::Theme::BASIC
|
user.theme_id.should == Gitlab::Theme::BASIC
|
||||||
|
|
Loading…
Reference in New Issue