diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-16 15:12:33 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-16 15:12:33 +0300 |
commit | de582ab375a1fd04b63ea351aabbff5b31bcad6b (patch) | |
tree | 7a313aeb42285ff6c05f1256568a6a5e9196dde7 /app/controllers/admin | |
parent | aa25c0ffe5c6904461ad42d0c48d571eb1809ea2 (diff) | |
download | gitlab-ce-de582ab375a1fd04b63ea351aabbff5b31bcad6b.tar.gz |
Fix user params when edit from admin area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/users_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 44c93471df4..0443e8b89ef 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -59,15 +59,17 @@ class Admin::UsersController < Admin::ApplicationController end def update + user_params_with_pass = user_params.dup + if params[:user][:password].present? - user_params.merge( + user_params_with_pass.merge!( password: params[:user][:password], password_confirmation: params[:user][:password_confirmation], ) end respond_to do |format| - if user.update_attributes(user_params) + if user.update_attributes(user_params_with_pass) user.confirm! format.html { redirect_to [:admin, user], notice: 'User was successfully updated.' } format.json { head :ok } |