diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-12-18 16:55:15 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-12-18 16:55:15 +0100 |
commit | 034ffc079e40e0c723173b5998242803cc28dc50 (patch) | |
tree | fee1b208be2068cf372ab23f268a66ca51cc2dc3 /app/controllers/admin | |
parent | 36d27e289177fdec5332539c94b8192022a412f2 (diff) | |
parent | 5bf100f87be571e86305f3ab244183fc46f1ede2 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/controllers/admin/base_controller.rb Some refactoring made upstream, no real conflict. - app/javascript/mastodon/features/compose/components/compose_form.js Updated using upstream's code but using maxChars instead of the hardcoded length of 500 characters per toot. - app/javascript/styles/mastodon/components.scss Upstream redesigned the onboarding modal. Not sure why we had a conflict there.
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/base_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/admin/confirmations_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/admin/resets_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/admin/roles_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/admin/two_factor_authentications_controller.rb | 4 |
5 files changed, 6 insertions, 18 deletions
diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb index f2190ddf9..cc6cd51f0 100644 --- a/app/controllers/admin/base_controller.rb +++ b/app/controllers/admin/base_controller.rb @@ -20,5 +20,9 @@ module Admin def set_pack use_pack 'admin' end + + def set_user + @user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound) + end end end diff --git a/app/controllers/admin/confirmations_controller.rb b/app/controllers/admin/confirmations_controller.rb index 8d3477e66..efe7dcbd4 100644 --- a/app/controllers/admin/confirmations_controller.rb +++ b/app/controllers/admin/confirmations_controller.rb @@ -25,10 +25,6 @@ module Admin private - def set_user - @user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound) - end - def check_confirmation if @user.confirmed? flash[:error] = I18n.t('admin.accounts.resend_confirmation.already_confirmed') diff --git a/app/controllers/admin/resets_controller.rb b/app/controllers/admin/resets_controller.rb index 3e27d01ac..db8f61d64 100644 --- a/app/controllers/admin/resets_controller.rb +++ b/app/controllers/admin/resets_controller.rb @@ -10,11 +10,5 @@ module Admin log_action :reset_password, @user redirect_to admin_accounts_path end - - private - - def set_user - @user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound) - end end end diff --git a/app/controllers/admin/roles_controller.rb b/app/controllers/admin/roles_controller.rb index af7ec0740..13f56e9be 100644 --- a/app/controllers/admin/roles_controller.rb +++ b/app/controllers/admin/roles_controller.rb @@ -17,11 +17,5 @@ module Admin log_action :demote, @user redirect_to admin_account_path(@user.account_id) end - - private - - def set_user - @user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound) - end end end diff --git a/app/controllers/admin/two_factor_authentications_controller.rb b/app/controllers/admin/two_factor_authentications_controller.rb index 022107203..2577a4b17 100644 --- a/app/controllers/admin/two_factor_authentications_controller.rb +++ b/app/controllers/admin/two_factor_authentications_controller.rb @@ -2,7 +2,7 @@ module Admin class TwoFactorAuthenticationsController < BaseController - before_action :set_user + before_action :set_target_user def destroy authorize @user, :disable_2fa? @@ -13,7 +13,7 @@ module Admin private - def set_user + def set_target_user @user = User.find(params[:user_id]) end end |