From caa4fbe326a4c66df51901fc4aee61df0db1211a Mon Sep 17 00:00:00 2001 From: Oneric Date: Tue, 17 Dec 2024 00:14:27 +0100 Subject: [PATCH] user: avoid database work on superfluous pin The only thing this does is changing the updated_at field of the user. Afaict this came to be because prior to pins federating this was split into two functions, one of which created a changeset, the other applying a given changeset. When this was merged the bits were just copied into place. --- lib/pleroma/user.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 2f4ac1b72..697597e1b 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -2581,10 +2581,10 @@ def add_pinned_object_id(%User{} = user, object_id) do [pinned_objects: "You have already pinned the maximum number of statuses"] end end) + |> update_and_set_cache() else - change(user) + {:ok, user} end - |> update_and_set_cache() end @spec remove_pinned_object_id(User.t(), String.t()) :: {:ok, t()} | {:error, term()}