diff options
| author | Izaak Alpert <ialpert@blackberry.com> | 2013-08-15 17:43:46 -0400 |
|---|---|---|
| committer | Izaak Alpert <ialpert@blackberry.com> | 2013-09-11 14:04:15 -0400 |
| commit | 5dae40f579f66fdc060de633b183ede7bd8b2ce4 (patch) | |
| tree | f4f6669cb1e4d035eb89de116fb3d9ab1f596136 /lib/api/users.rb | |
| parent | d4d4a78f834b409631b012aa555c0cb2c4e3166d (diff) | |
| download | gitlab-ce-5dae40f579f66fdc060de633b183ede7bd8b2ce4.tar.gz | |
Update to only provide one way to get a default user
-calling build_user will now apply defaults and only override them if as: :admin is set
Change-Id: Id1d938c0967752ecc14370af54f2d88128d18c44
Diffstat (limited to 'lib/api/users.rb')
| -rw-r--r-- | lib/api/users.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 3b7ae9f01a1..00dc2311ffd 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -45,9 +45,8 @@ module API post do authenticated_as_admin! required_attributes! [:email, :password, :name, :username] - - attrs = User.defaults.merge(attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :extern_uid, :provider, :bio]) - user = User.new attrs, as: :admin + attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :extern_uid, :provider, :bio] + user = User.build_user(attrs, as: :admin) if user.save present user, with: Entities::User else |
