From daba34101e228eecfa4d0f63aefd00655a2c2f68 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sun, 10 May 2020 17:40:58 +0200 Subject: [PATCH] fix bug --- management/commands/import_nk15.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/management/commands/import_nk15.py b/management/commands/import_nk15.py index a257d5f..96f27e1 100644 --- a/management/commands/import_nk15.py +++ b/management/commands/import_nk15.py @@ -173,12 +173,12 @@ def import_transaction(cur): cur.execute( "SELECT t.date AS transac_date, t.type, t.emetteur,\ t.destinataire,t.quantite, t.montant, t.description,\ - t.valide, t.cantinvalidate, t.categorie \ + t.valide, t.cantinvalidate, t.categorie, \ a.idbde, a.annee, a.wei, a.date AS adh_date, a.section\ FROM transactions AS t \ LEFT JOIN adhesions AS a ON t.id = a.idtransaction \ - WHERE transactions.id> {} \ - ORDER BY transactions.id;".format(idmin) + WHERE t.id> {} \ + ORDER BY t.id;".format(idmin) ) n = cur.rowcount for idx, row in enumerate(cur): @@ -303,7 +303,7 @@ def import_aliases(cur): cur.execute("SELECT * FROM aliases ORDER by id") n = cur.rowcount for idx, row in enumerate(cur): - update_line(idx, n, row["titre"]) + update_line(idx, n, row["alias"]) alias_name = row["alias"] alias_name_good = (alias_name[:252] + '...') if len(alias_name) > 255 else alias_name obj_dict = { @@ -469,7 +469,6 @@ class Command(BaseCommand): parser.add_argument('-t', '--transactions', action='store_true', help="import transaction") parser.add_argument('-al', '--aliases', action='store_true', help="import aliases") parser.add_argument('-ac', '--activities', action='store_true', help="import activities") - parser.add_argument('-M', '--memberships', action='store_true', help="import memberships") parser.add_argument('-r', '--remittances', action='store_true', help="import check remittances") parser.add_argument('-s', '--save', action='store', help="save mapping of idbde") parser.add_argument('-m', '--map', action='store', help="import mapping of idbde")