1
0
mirror of https://gitlab.crans.org/bde/nk20-scripts synced 2025-06-13 12:37:28 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
quark
694831a314 Merge branch 'merge_club' into 'master'
fix bug with merged transactions in merge_club command

See merge request bde/nk20-scripts!11
2025-05-07 14:59:50 +02:00
quark
8adaf5007e fix bug with merged transactions in merge_club command 2025-05-07 14:58:01 +02:00

View File

@ -3,6 +3,7 @@
import getpass
from time import sleep
from copy import copy
from django.conf import settings
from django.core.mail import mail_admins
@ -134,7 +135,8 @@ class Command(BaseCommand):
for tr in transactions:
if kwargs['verbosity'] >= 1:
self.stdout.write(f"Removing {tr}")
tr_merge = tr
tr_merge = copy(tr)
tr_merge.pk = None
tr_merge.source = true_club.note
local_created.append(tr_merge)
if kwargs['verbosity'] >= 1:
@ -155,7 +157,8 @@ class Command(BaseCommand):
for tr in transactions:
if kwargs['verbosity'] >= 1:
self.stdout.write(f"Removing {tr}")
tr_merge = tr
tr_merge = copy(tr)
tr_merge.pk = None
tr_merge.destination = true_club.note
local_created.append(tr_merge)
if kwargs['verbosity'] >= 1:
@ -279,6 +282,7 @@ class Command(BaseCommand):
for club in fake_clubs:
self.stdout.write(self.style.SUCCESS(f"Club {club} deleted and merge in {true_club}."))
deleted_clubs.append(clubs)
self.stdout.write(self.style.WARNING("There are problems with balance of inactive note impact by the fusion, run './manage.py check_consistency -a -f' to fix"))
deleted += local_deleted
created += local_created
edited += local_edited