fix(backend): only send suspension notification emails when actor's suspended and not just deleted

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-12-04 09:02:38 +01:00
parent 51e1ed642c
commit 9e41bc1ad6
2 changed files with 13 additions and 6 deletions

View File

@@ -20,7 +20,10 @@ defmodule Mobilizon.Service.Workers.Background do
reserve_username when is_boolean(reserve_username) ->
case Actors.get_actor(actor_id) do
%Actor{} = actor ->
ActorSuspension.suspend_actor(actor, reserve_username: reserve_username)
ActorSuspension.suspend_actor(actor,
reserve_username: reserve_username,
suspension: Map.get(args, "suspension", false)
)
nil ->
{:error, :actor_not_found}