diff --git a/lib/philomena/users.ex b/lib/philomena/users.ex index b02ed816..2e4704db 100644 --- a/lib/philomena/users.ex +++ b/lib/philomena/users.ex @@ -603,7 +603,7 @@ defmodule Philomena.Users do |> Multi.update(:account, account) |> Repo.transaction() |> case do - {:ok, %{account: %{name: new_name}}} = result -> + {:ok, %{account: %{name: new_name}}} -> spawn(fn -> Images.user_name_reindex(old_name, new_name) Comments.user_name_reindex(old_name, new_name) @@ -612,10 +612,10 @@ defmodule Philomena.Users do Reports.user_name_reindex(old_name, new_name) end) - result + {:ok, account} - result -> - result + {:error, :account, changeset, _changes} -> + {:error, changeset} end end diff --git a/lib/philomena_web/controllers/registration/name_controller.ex b/lib/philomena_web/controllers/registration/name_controller.ex index 4c089a72..3b71f483 100644 --- a/lib/philomena_web/controllers/registration/name_controller.ex +++ b/lib/philomena_web/controllers/registration/name_controller.ex @@ -19,7 +19,7 @@ defmodule PhilomenaWeb.Registration.NameController do |> put_flash(:info, "Name successfully updated.") |> redirect(to: Routes.profile_path(conn, :show, user)) - {:error, %{account: changeset}} -> + {:error, changeset} -> render(conn, "edit.html", changeset: changeset) end end