Fix user.ex

This commit is contained in:
Mirai Kumiko 2025-05-31 11:24:09 +02:00
parent 178c2bf72e
commit 022c07bdf5
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278

View file

@ -3,7 +3,7 @@ defmodule Nulla.User do
import Ecto.Changeset
schema "users" do
field :name, :string
field :username, :string
field :email, :string
field :password, :string
field :is_moderator, :boolean, default: false
@ -29,7 +29,7 @@ defmodule Nulla.User do
@doc false
def changeset(user, attrs) do
user
|> cast(attrs, [:name, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner])
|> validate_required([:name, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner])
|> cast(attrs, [:username, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner])
|> validate_required([:username, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner])
end
end