Verified Commit 01c2d2a2 authored by Alex Gleason's avatar Alex Gleason
Browse files

Also purge the user in User.perform/2

parent c6d41337
...@@ -1724,6 +1724,7 @@ def delete(users) when is_list(users) do ...@@ -1724,6 +1724,7 @@ def delete(users) when is_list(users) 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 @@ def perform(:force_password_reset, user), do: force_password_reset(user) ...@@ -1749,6 +1750,9 @@ def perform(:force_password_reset, user), do: force_password_reset(user)
@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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment