From 9b135fac07f2fd0d8473cdc4576e38b735ac315f Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 2 Nov 2020 14:12:19 +0100 Subject: [PATCH] misc: emit signals on DeletedUser creations (#48168) --- src/authentic2/custom_user/managers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/authentic2/custom_user/managers.py b/src/authentic2/custom_user/managers.py index 066846eae..8d8f72b53 100644 --- a/src/authentic2/custom_user/managers.py +++ b/src/authentic2/custom_user/managers.py @@ -130,15 +130,13 @@ class UserQuerySet(models.QuerySet): for user in loaded: logger.info(u'deleted account %s', user) transaction.on_commit(log) - deleted_users = [] for user in qs: deleted_user = DeletedUser(deleted=user.deleted, old_user_id=user.id) if 'email' in app_settings.A2_USER_DELETED_KEEP_DATA: deleted_user.old_email = user.email.rsplit('#', 1)[0] if 'uuid' in app_settings.A2_USER_DELETED_KEEP_DATA: deleted_user.old_uuid = user.uuid - deleted_users.append(deleted_user) - DeletedUser.objects.bulk_create(deleted_users) + deleted_user.save() qs.delete()