Handle black name fields on incoming users.
This commit is contained in:
parent
c2d0cb1a29
commit
fb7b926be3
2 changed files with 6 additions and 1 deletions
|
|
@ -417,7 +417,12 @@ defmodule Pleroma.User do
|
|||
end
|
||||
end
|
||||
|
||||
defp blank?(""), do: nil
|
||||
defp blank?(n), do: n
|
||||
|
||||
def insert_or_update_user(data) do
|
||||
data = data
|
||||
|> Map.put(:name, blank?(data[:name]) || data[:nickname])
|
||||
cs = User.remote_user_creation(data)
|
||||
Repo.insert(cs, on_conflict: :replace_all, conflict_target: :nickname)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue