From 02381f2820f9255453df94427e6fdb83e435daf0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 2 Nov 2022 17:13:16 +0100 Subject: [PATCH] Fix deleting person detached from user Signed-off-by: Thomas Citharel --- lib/mix/tasks/mobilizon/actors/delete.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mix/tasks/mobilizon/actors/delete.ex b/lib/mix/tasks/mobilizon/actors/delete.ex index ffe6a686..be55b0c2 100644 --- a/lib/mix/tasks/mobilizon/actors/delete.ex +++ b/lib/mix/tasks/mobilizon/actors/delete.ex @@ -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