mirror of
https://github.com/kikobar/mastodon.git
synced 2024-11-18 13:17:35 +00:00
3ed94dcc1a
Fix #10736 - Change data export to be available for non-functional accounts - Change non-functional accounts to include redirecting accounts
43 lines
905 B
Ruby
43 lines
905 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Settings::AliasesController < Settings::BaseController
|
|
layout 'admin'
|
|
|
|
before_action :authenticate_user!
|
|
before_action :set_aliases, except: :destroy
|
|
before_action :set_alias, only: :destroy
|
|
|
|
def index
|
|
@alias = current_account.aliases.build
|
|
end
|
|
|
|
def create
|
|
@alias = current_account.aliases.build(resource_params)
|
|
|
|
if @alias.save
|
|
redirect_to settings_aliases_path, notice: I18n.t('aliases.created_msg')
|
|
else
|
|
render :show
|
|
end
|
|
end
|
|
|
|
def destroy
|
|
@alias.destroy!
|
|
redirect_to settings_aliases_path, notice: I18n.t('aliases.deleted_msg')
|
|
end
|
|
|
|
private
|
|
|
|
def resource_params
|
|
params.require(:account_alias).permit(:acct)
|
|
end
|
|
|
|
def set_alias
|
|
@alias = current_account.aliases.find(params[:id])
|
|
end
|
|
|
|
def set_aliases
|
|
@aliases = current_account.aliases.order(id: :desc).reject(&:new_record?)
|
|
end
|
|
end
|