Remove User.upgrade_changeset in favor of remote_user_creation

The two changesets had the same purpose, yet some changes were updated
in one, but not the other (`uri`, for example).

Also makes `Transmogrifier.upgrade_user_from_ap_id` be called from
`ActivityPub.make_user_from_ap_id` only when the user is actually
not AP enabled yet.

I did not bother rewriting tests that used `User.insert_or_update`
to use the changeset instead because they seemed to just test the implementation,
rather than behavior.
This commit is contained in:
rinpatch 2020-04-11 21:44:52 +03:00
commit c077ad0b33
5 changed files with 31 additions and 124 deletions

View file

@ -29,7 +29,7 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do
{:ok, user} =
insert(:user)
|> User.upgrade_changeset(%{fields: fields})
|> User.update_changeset(%{fields: fields})
|> User.update_and_set_cache()
assert %{