diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-01-15 19:11:13 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-01-15 19:11:13 +0300 |
commit | a5db044e579ed9923e610cdf89dff6146d9b0986 (patch) | |
tree | f72f321dc438f1bba4e3a8ceb6edbc139cdaad92 /lib/pleroma/user.ex | |
parent | aa9fe3a712ac14dd2ee3227e6066bd3c47e9a5f3 (diff) | |
parent | 6317183acd767ba0ae1a245119d0276696444d92 (diff) | |
download | pleroma-a5db044e579ed9923e610cdf89dff6146d9b0986.tar.gz |
Merge branch 'develop' into feature/tag_feed
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r-- | lib/pleroma/user.ex | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 2e225415c..430f04ae9 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1874,22 +1874,13 @@ defmodule Pleroma.User do end def admin_api_update(user, params) do - changeset = - cast(user, params, [ - :is_moderator, - :is_admin, - :show_role - ]) - - with {:ok, updated_user} <- update_and_set_cache(changeset) do - if user.is_admin != updated_user.is_admin do - # Admin status change results in change of accessible OAuth scopes, and instead of changing - # already issued tokens we revoke them, requiring user to sign in again - global_sign_out(user) - end - - {:ok, updated_user} - end + user + |> cast(params, [ + :is_moderator, + :is_admin, + :show_role + ]) + |> update_and_set_cache() end @doc "Signs user out of all applications" |