From 63923df0a51fdae58daf71a8dd85929a29ab1546 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 16 Oct 2020 21:50:44 +0000 Subject: [PATCH] Further simplify changeset logic --- lib/pleroma/user.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 83a37890a..f6eca0109 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -2328,8 +2328,7 @@ defmodule Pleroma.User do @spec approval_changeset(User.t(), keyword()) :: Changeset.t() def approval_changeset(user, set_approval: approved?) do - params = if approved?, do: %{is_approved: true}, else: %{is_approved: false} - cast(user, params, [:is_approved]) + cast(user, %{is_approved: approved?}, [:is_approved]) end def add_pinnned_activity(user, %Pleroma.Activity{id: id}) do -- 2.45.2