Merge remote-tracking branch 'parent/main' into upstream-20240128
This commit is contained in:
commit
3e065f4e12
200 changed files with 2190 additions and 738 deletions
|
@ -34,7 +34,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:admin_account_action).permit(:type, :report_id, :warning_preset_id, :text, :send_email_notification, :include_statuses)
|
||||
params
|
||||
.expect(admin_account_action: [:type, :report_id, :warning_preset_id, :text, :send_email_notification, :include_statuses])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,10 +29,8 @@ module Admin
|
|||
private
|
||||
|
||||
def resource_params
|
||||
params.require(:account_moderation_note).permit(
|
||||
:content,
|
||||
:target_account_id
|
||||
)
|
||||
params
|
||||
.expect(account_moderation_note: [:content, :target_account_id])
|
||||
end
|
||||
|
||||
def set_account_moderation_note
|
||||
|
|
|
@ -172,7 +172,8 @@ module Admin
|
|||
end
|
||||
|
||||
def form_account_batch_params
|
||||
params.require(:form_account_batch).permit(:action, account_ids: [])
|
||||
params
|
||||
.expect(form_account_batch: [:action, account_ids: []])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -84,6 +84,7 @@ class Admin::AnnouncementsController < Admin::BaseController
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:announcement).permit(:text, :scheduled_at, :starts_at, :ends_at, :all_day)
|
||||
params
|
||||
.expect(announcement: [:text, :scheduled_at, :starts_at, :ends_at, :all_day])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -41,9 +41,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:user).permit(
|
||||
:unconfirmed_email
|
||||
)
|
||||
params
|
||||
.expect(user: [:unconfirmed_email])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -67,11 +67,13 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:custom_emoji).permit(:shortcode, :image, :category_id, :visible_in_picker, :aliases_raw, :license)
|
||||
params
|
||||
.expect(custom_emoji: [:shortcode, :image, :category_id, :visible_in_picker, :aliases_raw, :license])
|
||||
end
|
||||
|
||||
def update_params
|
||||
params.require(:custom_emoji).permit(:category_id, :visible_in_picker, :aliases_raw, :license)
|
||||
params
|
||||
.expect(custom_emoji: [:category_id, :visible_in_picker, :aliases_raw, :license])
|
||||
end
|
||||
|
||||
def filtered_custom_emojis
|
||||
|
@ -101,7 +103,8 @@ module Admin
|
|||
end
|
||||
|
||||
def form_custom_emoji_batch_params
|
||||
params.require(:form_custom_emoji_batch).permit(:action, :category_id, :category_name, custom_emoji_ids: [])
|
||||
params
|
||||
.expect(form_custom_emoji_batch: [:action, :category_id, :category_name, custom_emoji_ids: []])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -37,6 +37,7 @@ class Admin::DomainAllowsController < Admin::BaseController
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:domain_allow).permit(:domain)
|
||||
params
|
||||
.expect(domain_allow: [:domain])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -35,7 +35,9 @@ module Admin
|
|||
rescue Mastodon::NotPermittedError
|
||||
flash[:alert] = I18n.t('admin.domain_blocks.not_permitted')
|
||||
else
|
||||
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
|
||||
flash[:notice] = I18n.t('admin.domain_blocks.created_msg')
|
||||
ensure
|
||||
redirect_to admin_instances_path(limited: '1')
|
||||
end
|
||||
|
||||
def new
|
||||
|
@ -124,9 +126,14 @@ module Admin
|
|||
end
|
||||
|
||||
def form_domain_block_batch_params
|
||||
params.require(:form_domain_block_batch).permit(domain_blocks_attributes: [:enabled, :domain, :severity, :reject_media, :reject_favourite, :reject_reply_exclude_followers,
|
||||
:reject_send_sensitive, :reject_hashtag, :reject_straight_follow, :reject_new_follow, :reject_friend, :block_trends, :detect_invalid_subscription,
|
||||
:reject_reports, :private_comment, :public_comment, :obfuscate, :hidden])
|
||||
params
|
||||
.expect(
|
||||
form_domain_block_batch: [
|
||||
domain_blocks_attributes: [[:enabled, :domain, :severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate,
|
||||
:reject_favourite, :reject_reply_exclude_followers, :reject_send_sensitive, :reject_hashtag,
|
||||
:reject_straight_follow, :reject_new_follow, :reject_friend, :block_trends, :detect_invalid_subscription, :hidden]],
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -62,11 +62,13 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:email_domain_block).permit(:domain, :allow_with_approval, other_domains: [])
|
||||
params
|
||||
.expect(email_domain_block: [:domain, :allow_with_approval, other_domains: []])
|
||||
end
|
||||
|
||||
def form_email_domain_block_batch_params
|
||||
params.require(:form_email_domain_block_batch).permit(email_domain_block_ids: [])
|
||||
params
|
||||
.expect(form_email_domain_block_batch: [email_domain_block_ids: []])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -37,7 +37,8 @@ module Admin
|
|||
end
|
||||
|
||||
def form_account_batch_params
|
||||
params.require(:form_account_batch).permit(:action, account_ids: [])
|
||||
params
|
||||
.expect(form_account_batch: [:action, account_ids: []])
|
||||
end
|
||||
|
||||
def filter_params
|
||||
|
|
|
@ -39,7 +39,8 @@ module Admin
|
|||
private
|
||||
|
||||
def resource_params
|
||||
params.require(:invite).permit(:max_uses, :expires_in)
|
||||
params
|
||||
.expect(invite: [:max_uses, :expires_in])
|
||||
end
|
||||
|
||||
def filtered_invites
|
||||
|
|
|
@ -44,7 +44,8 @@ module Admin
|
|||
private
|
||||
|
||||
def resource_params
|
||||
params.require(:ip_block).permit(:ip, :severity, :comment, :expires_in)
|
||||
params
|
||||
.expect(ip_block: [:ip, :severity, :comment, :expires_in])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
@ -52,7 +53,8 @@ module Admin
|
|||
end
|
||||
|
||||
def form_ip_block_batch_params
|
||||
params.require(:form_ip_block_batch).permit(ip_block_ids: [])
|
||||
params
|
||||
.expect(form_ip_block_batch: [ip_block_ids: []])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -57,7 +57,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:relay).permit(:inbox_url)
|
||||
params
|
||||
.expect(relay: [:inbox_url])
|
||||
end
|
||||
|
||||
def warn_signatures_not_enabled!
|
||||
|
|
|
@ -47,10 +47,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:report_note).permit(
|
||||
:content,
|
||||
:report_id
|
||||
)
|
||||
params
|
||||
.expect(report_note: [:content, :report_id])
|
||||
end
|
||||
|
||||
def set_report_note
|
||||
|
|
|
@ -61,7 +61,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:user_role).permit(:name, :color, :highlighted, :position, permissions_as_keys: [])
|
||||
params
|
||||
.expect(user_role: [:name, :color, :highlighted, :position, permissions_as_keys: []])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -53,7 +53,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:rule).permit(:text, :hint, :priority)
|
||||
params
|
||||
.expect(rule: [:text, :hint, :priority])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,7 +28,8 @@ module Admin
|
|||
end
|
||||
|
||||
def settings_params
|
||||
params.require(:form_admin_settings).permit(*Form::AdminSettings::KEYS)
|
||||
params
|
||||
.expect(form_admin_settings: [*Form::AdminSettings::KEYS])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -98,7 +98,8 @@ module Admin
|
|||
helper_method :batched_ordered_status_edits
|
||||
|
||||
def admin_status_batch_action_params
|
||||
params.require(:admin_status_batch_action).permit(status_ids: [])
|
||||
params
|
||||
.expect(admin_status_batch_action: [status_ids: []])
|
||||
end
|
||||
|
||||
def after_create_redirect_path
|
||||
|
|
|
@ -37,7 +37,8 @@ module Admin
|
|||
end
|
||||
|
||||
def tag_params
|
||||
params.require(:tag).permit(:name, :display_name, :trendable, :usable, :listable)
|
||||
params
|
||||
.expect(tag: [:name, :display_name, :trendable, :usable, :listable])
|
||||
end
|
||||
|
||||
def filtered_tags
|
||||
|
|
|
@ -31,6 +31,7 @@ class Admin::TermsOfService::DraftsController < Admin::BaseController
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:terms_of_service).permit(:text, :changelog)
|
||||
params
|
||||
.expect(terms_of_service: [:text, :changelog])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,6 +32,7 @@ class Admin::TermsOfService::GeneratesController < Admin::BaseController
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:terms_of_service_generator).permit(*TermsOfService::Generator::VARIABLES)
|
||||
params
|
||||
.expect(terms_of_service_generator: [*TermsOfService::Generator::VARIABLES])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,7 +31,8 @@ class Admin::Trends::Links::PreviewCardProvidersController < Admin::BaseControll
|
|||
end
|
||||
|
||||
def trends_preview_card_provider_batch_params
|
||||
params.require(:trends_preview_card_provider_batch).permit(:action, preview_card_provider_ids: [])
|
||||
params
|
||||
.expect(trends_preview_card_provider_batch: [:action, preview_card_provider_ids: []])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -31,7 +31,8 @@ class Admin::Trends::LinksController < Admin::BaseController
|
|||
end
|
||||
|
||||
def trends_preview_card_batch_params
|
||||
params.require(:trends_preview_card_batch).permit(:action, preview_card_ids: [])
|
||||
params
|
||||
.expect(trends_preview_card_batch: [:action, preview_card_ids: []])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -31,7 +31,8 @@ class Admin::Trends::StatusesController < Admin::BaseController
|
|||
end
|
||||
|
||||
def trends_status_batch_params
|
||||
params.require(:trends_status_batch).permit(:action, status_ids: [])
|
||||
params
|
||||
.expect(trends_status_batch: [:action, status_ids: []])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -31,7 +31,8 @@ class Admin::Trends::TagsController < Admin::BaseController
|
|||
end
|
||||
|
||||
def trends_tag_batch_params
|
||||
params.require(:trends_tag_batch).permit(:action, tag_ids: [])
|
||||
params
|
||||
.expect(trends_tag_batch: [:action, tag_ids: []])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -28,7 +28,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:user).permit(:role_id)
|
||||
params
|
||||
.expect(user: [:role_id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -52,7 +52,8 @@ module Admin
|
|||
end
|
||||
|
||||
def warning_preset_params
|
||||
params.require(:account_warning_preset).permit(:title, :text)
|
||||
params
|
||||
.expect(account_warning_preset: [:title, :text])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -74,7 +74,8 @@ module Admin
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.require(:webhook).permit(:url, :template, events: [])
|
||||
params
|
||||
.expect(webhook: [:url, :template, events: []])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -73,7 +73,7 @@ class Auth::SessionsController < Devise::SessionsController
|
|||
end
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(:email, :password, :otp_attempt, :disable_css, credential: {})
|
||||
params.expect(user: [:email, :password, :otp_attempt, :disable_css, credential: {}])
|
||||
end
|
||||
|
||||
def login_page_params
|
||||
|
|
|
@ -24,6 +24,6 @@ module Admin::ExportControllerConcern
|
|||
end
|
||||
|
||||
def import_params
|
||||
params.require(:admin_import).permit(:data)
|
||||
params.expect(admin_import: [:data])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -58,6 +58,6 @@ module ChallengableConcern
|
|||
end
|
||||
|
||||
def challenge_params
|
||||
params.require(:form_challenge).permit(:current_password, :return_to)
|
||||
params.expect(form_challenge: [:current_password, :return_to])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -34,7 +34,7 @@ class Filters::StatusesController < ApplicationController
|
|||
end
|
||||
|
||||
def status_filter_batch_action_params
|
||||
params.require(:form_status_filter_batch_action).permit(status_filter_ids: [])
|
||||
params.expect(form_status_filter_batch_action: [status_filter_ids: []])
|
||||
end
|
||||
|
||||
def action_from_button
|
||||
|
|
|
@ -36,7 +36,7 @@ class RelationshipsController < ApplicationController
|
|||
end
|
||||
|
||||
def form_account_batch_params
|
||||
params.require(:form_account_batch).permit(:action, account_ids: [])
|
||||
params.expect(form_account_batch: [:action, account_ids: []])
|
||||
end
|
||||
|
||||
def following_relationship?
|
||||
|
|
|
@ -60,16 +60,12 @@ class Settings::ApplicationsController < Settings::BaseController
|
|||
end
|
||||
|
||||
def application_params
|
||||
params.require(:doorkeeper_application).permit(
|
||||
:name,
|
||||
:redirect_uri,
|
||||
:scopes,
|
||||
:website
|
||||
)
|
||||
params
|
||||
.expect(doorkeeper_application: [:name, :redirect_uri, :scopes, :website])
|
||||
end
|
||||
|
||||
def prepare_scopes
|
||||
scopes = params.fetch(:doorkeeper_application, {}).fetch(:scopes, nil)
|
||||
scopes = application_params.fetch(:doorkeeper_application, {}).fetch(:scopes, nil)
|
||||
params[:doorkeeper_application][:scopes] = scopes.join(' ') if scopes.is_a? Array
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,10 +25,10 @@ class Settings::Preferences::BaseController < Settings::BaseController
|
|||
end
|
||||
|
||||
def original_user_params
|
||||
params.require(:user).permit(:locale, :time_zone, :custom_css_text, chosen_languages: [], settings_attributes: UserSettings.keys)
|
||||
params.expect(user: [:locale, :time_zone, :custom_css_text, chosen_languages: [], settings_attributes: UserSettings.keys])
|
||||
end
|
||||
|
||||
def disabled_visibilities_params
|
||||
params.require(:user).permit(settings_attributes: { enabled_visibilities: [] })
|
||||
params.expect(user: [settings_attributes: { enabled_visibilities: [] }])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,7 +38,7 @@ module Settings
|
|||
private
|
||||
|
||||
def confirmation_params
|
||||
params.require(:form_two_factor_confirmation).permit(:otp_attempt)
|
||||
params.expect(form_two_factor_confirmation: [:otp_attempt])
|
||||
end
|
||||
|
||||
def prepare_two_factor_form
|
||||
|
|
|
@ -18,7 +18,7 @@ class Settings::VerificationsController < Settings::BaseController
|
|||
private
|
||||
|
||||
def account_params
|
||||
params.require(:account).permit(:attribution_domains).tap do |params|
|
||||
params.expect(account: [:attribution_domains]).tap do |params|
|
||||
params[:attribution_domains] = params[:attribution_domains].split if params[:attribution_domains]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue