mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
fix changeset error when uploading avatar
This commit is contained in:
parent
c9331f61b4
commit
c1d54de22a
2 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue