From 16d8c8b33b654b88e5e934832d5e26eb7152633e Mon Sep 17 00:00:00 2001 From: Sadposter Date: Sun, 14 Apr 2019 16:05:26 +0100 Subject: [PATCH] Assert on the success of enqueue before returning --- lib/pleroma/user.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 78eb29ddd..f3ea5289e 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -278,9 +278,10 @@ def register(%Ecto.Changeset{} = changeset) do def try_send_confirmation_email(%User{} = user) do if user.info.confirmation_pending && Pleroma.Config.get([:instance, :account_activation_required]) do - user - |> Pleroma.Emails.UserEmail.account_confirmation_email() - |> Pleroma.Emails.Mailer.deliver_async() + :ok = + user + |> Pleroma.Emails.UserEmail.account_confirmation_email() + |> Pleroma.Emails.Mailer.deliver_async() {:ok, :enqueued} else