mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-27 21:25:20 +01:00
Make a new function instead of overloading register_changeset/3
This commit is contained in:
parent
6ddea8ebe8
commit
474147a67a
@ -639,7 +639,7 @@ defmodule Pleroma.User do
|
|||||||
def force_password_reset(user), do: update_password_reset_pending(user, true)
|
def force_password_reset(user), do: update_password_reset_pending(user, true)
|
||||||
|
|
||||||
# Used to auto-register LDAP accounts which won't have a password hash stored locally
|
# Used to auto-register LDAP accounts which won't have a password hash stored locally
|
||||||
def register_changeset(struct, params = %{password: password})
|
def register_changeset_ldap(struct, params = %{password: password})
|
||||||
when is_nil(password) do
|
when is_nil(password) do
|
||||||
params = Map.put_new(params, :accepts_chat_messages, true)
|
params = Map.put_new(params, :accepts_chat_messages, true)
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ defmodule Pleroma.Web.Auth.LDAPAuthenticator do
|
|||||||
_ -> params
|
_ -> params
|
||||||
end
|
end
|
||||||
|
|
||||||
changeset = User.register_changeset(%User{}, params)
|
changeset = User.register_changeset_ldap(%User{}, params)
|
||||||
|
|
||||||
case User.register(changeset) do
|
case User.register(changeset) do
|
||||||
{:ok, user} -> user
|
{:ok, user} -> user
|
||||||
|
Loading…
Reference in New Issue
Block a user