mirror of
https://gitlab.crans.org/bde/nk20-scripts
synced 2025-05-08 07:11:32 +00:00
fix bug with merged transactions in merge_club command
This commit is contained in:
parent
57c0c253fe
commit
8adaf5007e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user