diff --git a/lib/philomena/users/user.ex b/lib/philomena/users/user.ex index 360f157b..05d6a01c 100644 --- a/lib/philomena/users/user.ex +++ b/lib/philomena/users/user.ex @@ -368,6 +368,7 @@ defmodule Philomena.Users.User do :avatar_width, :avatar_height, :avatar_size, + :avatar_mime_type, :uploaded_avatar, :removed_avatar ]) @@ -376,6 +377,7 @@ defmodule Philomena.Users.User do :avatar_width, :avatar_height, :avatar_size, + :avatar_mime_type, :uploaded_avatar ]) |> validate_number(:avatar_size, greater_than: 0, less_than_or_equal_to: 300_000) diff --git a/lib/philomena_web/controllers/avatar_controller.ex b/lib/philomena_web/controllers/avatar_controller.ex index 109fd337..50a30cf2 100644 --- a/lib/philomena_web/controllers/avatar_controller.ex +++ b/lib/philomena_web/controllers/avatar_controller.ex @@ -20,7 +20,7 @@ defmodule PhilomenaWeb.AvatarController do |> put_flash(:info, "Successfully updated avatar.") |> redirect(to: Routes.avatar_path(conn, :edit)) - {:error, :user, changeset, _changes} -> + {:error, changeset} -> render(conn, "edit.html", changeset: changeset) end end