From: Sachin Joshi Date: Sat, 1 Jun 2019 05:57:37 +0000 (+0545) Subject: Merge remote-tracking branch 'upstream/develop' into admin-create-users X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=ad5263c647aea65dbeb4c329825671895e0a8863;p=akkoma Merge remote-tracking branch 'upstream/develop' into admin-create-users --- ad5263c647aea65dbeb4c329825671895e0a8863 diff --cc lib/pleroma/user.ex index 722e8ff6b,474cd8c1a..6abcb7288 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@@ -276,15 -277,9 +277,15 @@@ defmodule Pleroma.User d @doc "Inserts provided changeset, performs post-registration actions (confirmation email sending etc.)" def register(%Ecto.Changeset{} = changeset) do with {:ok, user} <- Repo.insert(changeset), - {:ok, user} <- autofollow_users(user), + {:ok, user} <- post_register_action(user) do + {:ok, user} + end + end + + def post_register_action(%User{} = user) do + with {:ok, user} <- autofollow_users(user), {:ok, user} <- set_cache(user), - {:ok, _} <- Pleroma.User.WelcomeMessage.post_welcome_message_to_user(user), + {:ok, _} <- User.WelcomeMessage.post_welcome_message_to_user(user), {:ok, _} <- try_send_confirmation_email(user) do {:ok, user} end