Fix deleting person detached from user

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-11-02 17:13:16 +01:00
parent 4be5cc787e
commit 02381f2820
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 2 additions and 1 deletions

View File

@ -93,7 +93,8 @@ defmodule Mix.Tasks.Mobilizon.Actors.Delete do
end
end
defp check_actor(%Actor{type: :Person, domain: nil} = profile, assume_yes?) do
defp check_actor(%Actor{type: :Person, domain: nil, user_id: user_id} = profile, assume_yes?)
when not is_nil(user_id) do
%User{actors: actors, email: email} = Users.get_user_with_actors!(profile.user_id)
if length(actors) == 1 do