In the force delete script, delete transactions transaction by transaction
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
5ce65e36a8
commit
0fc9c4c50e
|
@ -78,11 +78,11 @@ class Command(BaseCommand):
|
||||||
# Deleting transactions
|
# Deleting transactions
|
||||||
transactions = Transaction.objects.filter(Q(source=user.note) | Q(destination=user.note)).all()
|
transactions = Transaction.objects.filter(Q(source=user.note) | Q(destination=user.note)).all()
|
||||||
local_deleted += list(transactions)
|
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}...")
|
self.stdout.write(f"Removing {tr}...")
|
||||||
if force:
|
if force:
|
||||||
transactions.delete()
|
tr.delete()
|
||||||
|
|
||||||
# Deleting memberships
|
# Deleting memberships
|
||||||
memberships = user.memberships.all()
|
memberships = user.memberships.all()
|
||||||
|
|
Loading…
Reference in New Issue