Send mail to admins if a user got deleted iff it was successfully deleted

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-04-22 18:33:20 +02:00
parent 961365656c
commit 0c7070aea1
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 2 additions and 1 deletions

View File

@ -173,4 +173,5 @@ class Command(BaseCommand):
message += "Ont été supprimés en conséquence les objets suivants :\n\n"
for obj in deleted:
message += f"{repr(obj)} (pk: {obj.pk})\n"
mail_admins("Utilisateurs supprimés", message)
if force and kwargs['doit']:
mail_admins("Utilisateurs supprimés", message)