Fully delete users with status :approval_pending

This commit is contained in:
Alex Gleason 2020-07-17 12:19:41 -05:00
commit 5756843736
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 18 additions and 6 deletions

View file

@ -1525,12 +1525,13 @@ defmodule Pleroma.User do
defp delete_or_deactivate(%User{local: true} = user) do
status = account_status(user)
if status == :confirmation_pending do
delete_and_invalidate_cache(user)
else
user
|> change(%{deactivated: true, email: nil})
|> update_and_set_cache()
case status do
:confirmation_pending -> delete_and_invalidate_cache(user)
:approval_pending -> delete_and_invalidate_cache(user)
_ ->
user
|> change(%{deactivated: true, email: nil})
|> update_and_set_cache()
end
end