diff --git a/management/commands/force_delete_user.py b/management/commands/force_delete_user.py index 2a829ab..3c4fbd5 100644 --- a/management/commands/force_delete_user.py +++ b/management/commands/force_delete_user.py @@ -78,11 +78,11 @@ class Command(BaseCommand): # Deleting transactions transactions = Transaction.objects.filter(Q(source=user.note) | Q(destination=user.note)).all() local_deleted += list(transactions) - if kwargs['verbosity'] >= 1: - for tr in transactions: + for tr in transactions: + if kwargs['verbosity'] >= 1: self.stdout.write(f"Removing {tr}...") - if force: - transactions.delete() + if force: + tr.delete() # Deleting memberships memberships = user.memberships.all()