diff options
Diffstat (limited to 'app/controllers/admin/users_controller.rb')
-rw-r--r-- | app/controllers/admin/users_controller.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index bfa7c7d0109..17a2c7924ab 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -96,20 +96,20 @@ class Admin::UsersController < Admin::ApplicationController update_user { |user| user.disable_two_factor! } redirect_to admin_user_path(user), - notice: 'Two-factor Authentication has been disabled for this user' + notice: "Two-factor Authentication has been disabled for this user" end def create opts = { reset_password: true, - skip_confirmation: true + skip_confirmation: true, } @user = Users::CreateService.new(current_user, user_params.merge(opts)).execute respond_to do |format| if @user.persisted? - format.html { redirect_to [:admin, @user], notice: 'User was successfully created.' } + format.html { redirect_to [:admin, @user], notice: "User was successfully created." } format.json { render json: @user, status: :created, location: @user } else format.html { render "new" } @@ -124,7 +124,7 @@ class Admin::UsersController < Admin::ApplicationController if params[:user][:password].present? password_params = { password: params[:user][:password], - password_confirmation: params[:user][:password_confirmation] + password_confirmation: params[:user][:password_confirmation], } password_params[:password_expires_at] = Time.now unless changing_own_password? @@ -133,12 +133,12 @@ class Admin::UsersController < Admin::ApplicationController end respond_to do |format| - result = Users::UpdateService.new(current_user, user_params_with_pass.merge(user: user)).execute do |user| + result = Users::UpdateService.new(current_user, user_params_with_pass.merge(user: user)).execute { |user| user.skip_reconfirmation! - end + } if result[:status] == :success - format.html { redirect_to [:admin, user], notice: 'User was successfully updated.' } + format.html { redirect_to [:admin, user], notice: "User was successfully updated." } format.json { head :ok } else # restore username to keep form action url. @@ -164,11 +164,11 @@ class Admin::UsersController < Admin::ApplicationController respond_to do |format| if success - format.html { redirect_back_or_admin_user(notice: 'Successfully removed email.') } + format.html { redirect_back_or_admin_user(notice: "Successfully removed email.") } format.json { head :ok } else - format.html { redirect_back_or_admin_user(alert: 'There was an error removing the e-mail.') } - format.json { render json: 'There was an error removing the e-mail.', status: :bad_request } + format.html { redirect_back_or_admin_user(alert: "There was an error removing the e-mail.") } + format.json { render json: "There was an error removing the e-mail.", status: :bad_request } end end end @@ -223,7 +223,7 @@ class Admin::UsersController < Admin::ApplicationController :theme_id, :twitter, :username, - :website_url + :website_url, ] end |