From 1e6c102bfcfe0e4835a48f2483f2376f9bf86a20 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 31 Dec 2018 12:18:59 +0100 Subject: [PATCH] Web.AdminAPI.AdminAPIController: Remove a useless if in user_delete --- lib/pleroma/web/admin_api/admin_api_controller.ex | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex index 49d237661..2b66a1848 100644 --- a/lib/pleroma/web/admin_api/admin_api_controller.ex +++ b/lib/pleroma/web/admin_api/admin_api_controller.ex @@ -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) -- 2.45.2