mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
25 lines
520 B
Ruby
25 lines
520 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Admin
|
|
class Accounts::AvatarsController < BaseController
|
|
before_action :set_account
|
|
|
|
def destroy
|
|
authorize @account, :remove_avatar?
|
|
|
|
@account.avatar = nil
|
|
@account.save!
|
|
|
|
log_action :remove_avatar, @account.user
|
|
|
|
redirect_to admin_account_path(@account.id), notice: t('admin.accounts.removed_avatar_msg', username: @account.acct)
|
|
end
|
|
|
|
private
|
|
|
|
def set_account
|
|
@account = Account.find(params[:account_id])
|
|
end
|
|
end
|
|
end
|