diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-26 04:14:54 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-26 04:14:54 +0300 |
commit | d41b2085fee554b08992bbd5783c07a8350540a2 (patch) | |
tree | 27b70a49b07d26f159ebf4a6479afa0ccc4beafc /lib/api | |
parent | ee7364a6e47f1b6d0be7e0ecc7415e51a91974b6 (diff) | |
parent | fda55f9145b5280db28cd6723789f95e2cb7b6c0 (diff) |
Merge branch 'master' into 'master'
Change ordering so that confirm is removed from attrs before attempting to User.build_user
Possible fix gitlab-org/gitlab-ce#1296
See merge request !445
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/users.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 7c8b3250cd0..032a5d76e43 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -61,10 +61,10 @@ module API authenticated_as_admin! required_attributes! [:email, :password, :name, :username] attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :bio, :can_create_group, :admin, :confirm] - user = User.build_user(attrs) admin = attrs.delete(:admin) - user.admin = admin unless admin.nil? confirm = !(attrs.delete(:confirm) =~ (/(false|f|no|0)$/i)) + user = User.build_user(attrs) + user.admin = admin unless admin.nil? user.skip_confirmation! unless confirm identity_attrs = attributes_for_keys [:provider, :extern_uid] |