Also purge the user in User.perform/2

This commit is contained in:
Alex Gleason 2021-06-29 22:53:33 -05:00
parent c6d4133727
commit 01c2d2a296
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

View File

@ -1724,6 +1724,7 @@ defmodule Pleroma.User do
end end
def delete(%User{} = user) do def delete(%User{} = user) do
# Purge the user immediately
purge(user) purge(user)
BackgroundWorker.enqueue("delete_user", %{"user_id" => user.id}) BackgroundWorker.enqueue("delete_user", %{"user_id" => user.id})
end end
@ -1749,6 +1750,9 @@ defmodule Pleroma.User do
@spec perform(atom(), User.t()) :: {:ok, User.t()} @spec perform(atom(), User.t()) :: {:ok, User.t()}
def perform(:delete, %User{} = user) do def perform(:delete, %User{} = user) do
# Purge the user again, in case perform/2 is called directly
purge(user)
# Remove all relationships # Remove all relationships
user user
|> get_followers() |> get_followers()