From 84be9d0062beee2c1dc09f2f7ef082e6f6240ad1 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 20 Oct 2020 00:19:33 +0200 Subject: [PATCH] Note account has a special treatment in potential future NK15 import (compatibility commit) --- management/commands/import_account.py | 4 ++++ management/commands/import_transaction.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/management/commands/import_account.py b/management/commands/import_account.py index d520187..c38c856 100644 --- a/management/commands/import_account.py +++ b/management/commands/import_account.py @@ -114,6 +114,10 @@ class Command(ImportCommand): else: passwd_nk15 = '' + # Note account should have no password + if int(row["idbde"]) == 3508: + passwd_nk15 = "ipbased$127.0.0.1" + if row["idbde"] not in MAP_IDBDE_PROMOTION: # NK12 bug. Applying default values MAP_IDBDE_PROMOTION[row["idbde"]] = {"promo": 2014, diff --git a/management/commands/import_transaction.py b/management/commands/import_transaction.py index c29d5bd..3af945b 100644 --- a/management/commands/import_transaction.py +++ b/management/commands/import_transaction.py @@ -316,6 +316,12 @@ class Command(ImportCommand): ) bulk_mgr.done() + # Note account has a different treatment + for m in Membership.objects.filter(user_username="note").all(): + m.date_end = "3142-12-12" + m.roles.set([20]) # PC Kfet role + m.save() + @timed @transaction.atomic def import_remittances(self, cur, chunk_size):