mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-26 15:31:52 +00:00
Fix some actions being logged on idempotent calls
This commit is contained in:
parent
53817294fc
commit
0222970ab2
|
@ -46,8 +46,10 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
||||||
|
|
||||||
def enable
|
def enable
|
||||||
authorize @account.user, :enable?
|
authorize @account.user, :enable?
|
||||||
|
if @account.user.disabled
|
||||||
@account.user.enable!
|
@account.user.enable!
|
||||||
log_action :enable, @account.user
|
log_action :enable, @account.user
|
||||||
|
end
|
||||||
render json: @account, serializer: REST::Admin::AccountSerializer
|
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -71,15 +73,19 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
||||||
|
|
||||||
def unsensitive
|
def unsensitive
|
||||||
authorize @account, :unsensitive?
|
authorize @account, :unsensitive?
|
||||||
|
if @account.sensitized?
|
||||||
@account.unsensitize!
|
@account.unsensitize!
|
||||||
log_action :unsensitive, @account
|
log_action :unsensitive, @account
|
||||||
|
end
|
||||||
render json: @account, serializer: REST::Admin::AccountSerializer
|
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def unsilence
|
def unsilence
|
||||||
authorize @account, :unsilence?
|
authorize @account, :unsilence?
|
||||||
|
if @account.silenced?
|
||||||
@account.unsilence!
|
@account.unsilence!
|
||||||
log_action :unsilence, @account
|
log_action :unsilence, @account
|
||||||
|
end
|
||||||
render json: @account, serializer: REST::Admin::AccountSerializer
|
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user