From 42912cca755f954a33ae57e9dc8a588887b598d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ch=C3=A9rifBALDE?= Date: Thu, 11 Aug 2022 20:02:43 +0200 Subject: [PATCH] 11/08/22 - 20:00 --- ela_factures_mgt.py | 21 +++++++++++++++++++++ partners.py | 1 + 2 files changed, 22 insertions(+) diff --git a/ela_factures_mgt.py b/ela_factures_mgt.py index 86950f7..6deae44 100644 --- a/ela_factures_mgt.py +++ b/ela_factures_mgt.py @@ -234,6 +234,27 @@ def add_payement_mode(diction): ) if (ret_val['_id'] is False): + mycommon.myprint( + str(inspect.stack()[0][3]) + " : Impossible d'ajouter le mode de payement") + return False, "Impossible d'ajouter le mode de payement" + + + ''' + Une fois que le mode de payement est ajouté, alors valide le compte partenaire + en mettant : ispending à 0 + ''' + coll_name = MYSY_GV.dbname['partnair_account'] + data_update = {'date_update':str(datetime.now()), 'ispending':'0'} + ret_val = coll_name.find_one_and_update( + {'recid': user_recid, }, + {"$set": data_update}, + upsert=False, + return_document=ReturnDocument.AFTER + ) + + if (ret_val['_id'] is False): + mycommon.myprint( + str(inspect.stack()[0][3]) + " : Impossible de mettre à jour (ispending':'1') le compte partenaire") return False, "Impossible d'ajouter le mode de payement" diff --git a/partners.py b/partners.py index e5da735..29dbe05 100644 --- a/partners.py +++ b/partners.py @@ -973,6 +973,7 @@ def UpgradetoPro(diction): ''' mydata = {} mydata['migrated'] = "1" + mydata['ispending'] = "1" mydata['migrated_date'] = str(datetime.now()) mydata['migrated_mail_account'] = new_diction['email'] ret_val = coll_user_account.find_one_and_update(