From: Mark Felder Date: Fri, 16 Oct 2020 21:50:44 +0000 (+0000) Subject: Further simplify changeset logic X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=63923df0a51fdae58daf71a8dd85929a29ab1546;p=akkoma Further simplify changeset logic --- 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