diff options
author | Azul <azul@riseup.net> | 2016-05-23 12:27:14 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-05-23 13:01:52 +0200 |
commit | ad208ae3625e67c2551744df7906ebdda94d215e (patch) | |
tree | 45530918ef86f0d565c597a0310f858f1cb4d841 /app/controllers/api | |
parent | f47fc9d6522886cf81cfea26ec1f396219c539ba (diff) |
rename destroy_identity to release_handles
This expresses the intent rather than the implementation.
Also replace temp with query refactoring.
Diffstat (limited to 'app/controllers/api')
-rw-r--r-- | app/controllers/api/users_controller.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/api/users_controller.rb b/app/controllers/api/users_controller.rb index e64d21f..c79a729 100644 --- a/app/controllers/api/users_controller.rb +++ b/app/controllers/api/users_controller.rb @@ -50,8 +50,7 @@ module Api end def destroy - destroy_identity = current_user.is_monitor? || params[:identities] == "destroy" - @user.account.destroy(destroy_identity) + @user.account.destroy(release_handles) if @user == current_user logout end @@ -60,6 +59,10 @@ module Api private + def release_handles + current_user.is_monitor? || params[:identities] == "destroy" + end + # tester auth can only create test users. def create_test_account if User::is_test?(params[:user][:login]) |