Web.AdminAPI.AdminAPIController: Remove a useless if in user_delete
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 31 Dec 2018 11:18:59 +0000 (12:18 +0100)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 31 Dec 2018 18:50:14 +0000 (19:50 +0100)
lib/pleroma/web/admin_api/admin_api_controller.ex

index 49d237661f69ff9b1eb52ce320c056ed54f5a142..2b66a18488a7c325020989e6ab8ff264a423c997 100644 (file)
@@ -14,13 +14,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
   action_fallback(:errors)
 
   def user_delete(conn, %{"nickname" => nickname}) do
-    user = User.get_by_nickname(nickname)
-
-    if user.local == true do
-      User.delete(user)
-    else
-      User.delete(user)
-    end
+    User.get_by_nickname(nickname)
+    |> User.delete()
 
     conn
     |> json(nickname)