diff options
author | rinpatch <rinpatch@sdf.org> | 2020-08-10 09:04:16 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-08-10 09:04:16 +0000 |
commit | 21dfcafeb1ecca43e9ba61a4fc11dca67b723d4e (patch) | |
tree | bdf5fb16cf34b7fa4f180c1efdef0524c30be11e | |
parent | 0149dd01469b7c52f4abe173157b8b5cc4442ff6 (diff) | |
parent | 66122a11b59a3859f3eb67066148e9c75139d3ee (diff) | |
download | pleroma-21dfcafeb1ecca43e9ba61a4fc11dca67b723d4e.tar.gz pleroma-21dfcafeb1ecca43e9ba61a4fc11dca67b723d4e.zip |
Merge branch '2038-old-update-info' into 'develop'
AccountController: Build the correct update activity.
Closes #2038
See merge request pleroma/pleroma!2867
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/account_controller.ex | 2 | ||||
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index f45678184..95d8452df 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -226,7 +226,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do with changeset <- User.update_changeset(user, user_params), {:ok, unpersisted_user} <- Ecto.Changeset.apply_action(changeset, :update), updated_object <- - Pleroma.Web.ActivityPub.UserView.render("user.json", user: user) + Pleroma.Web.ActivityPub.UserView.render("user.json", user: unpersisted_user) |> Map.delete("@context"), {:ok, update_data, []} <- Builder.update(user, updated_object), {:ok, _update, _} <- diff --git a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs index b888e4c71..2e6704726 100644 --- a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs +++ b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs @@ -214,6 +214,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do assert user_data = json_response_and_validate_schema(conn, 200) assert user_data["display_name"] == "markorepairs" + + update_activity = Repo.one(Pleroma.Activity) + assert update_activity.data["type"] == "Update" + assert update_activity.data["object"]["name"] == "markorepairs" end test "updates the user's avatar", %{user: user, conn: conn} do |