On user making, check if we have a user with that uri.

This commit is contained in:
Roger Braun 2017-05-12 18:58:25 +02:00
parent 04544da8f1
commit d95ac274d6

View file

@ -235,8 +235,12 @@ def make_user(uri) do
info: info,
avatar: info["avatar"]
}
cs = User.remote_user_creation(data)
Repo.insert(cs)
with %User{} = user <- User.get_by_ap_id(data.ap_id) do
{:ok, user}
else _e ->
cs = User.remote_user_creation(data)
Repo.insert(cs)
end
end
end