10/08/22 - 12h30

master
ChérifBALDE 2022-08-10 13:07:07 +02:00 committed by cherif
parent b8c434b661
commit b514c8b7a9
5 changed files with 50 additions and 16 deletions

View File

@ -1502,7 +1502,7 @@ def add_class_mass(file=None, Folder=None, diction=None):
print(str(total_rows)+" formations ont été inserées")
return True, str(total_rows)+" formations ont été inserées"
return True, str(total_rows)+" formations ont été inserées / Mises à jour"
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()

View File

@ -393,6 +393,11 @@ def createOrder(diction):
new_data['client_recid'] = user_recid
coll_part_account = MYSY_GV.dbname['partnair_account']
part_account = coll_part_account.find({'recid':user_recid, 'active':'1'})
if (part_account.count() <= 0):
mycommon.myprint(
str(inspect.stack()[0][3]) + "Aucune donnée client, Impossible de créer la commande ")
return False, "Aucune donnée client,, Impossible de créer la commande ", None
if ("invoice_nom" in part_account[0].keys()):
if part_account[0]['invoice_nom']:
@ -434,6 +439,10 @@ def createOrder(diction):
# Recuperation ds données de payement
coll_part_payment = MYSY_GV.dbname['payement_mode']
part_account = coll_part_payment.find({'client_recid': user_recid, 'valide': '1'})
if( part_account.count() <= 0 ):
mycommon.myprint(
str(inspect.stack()[0][3]) + "Aucune donnée de payement, Impossible de créer la commande ")
return False, "Aucune donnée de payement,, Impossible de créer la commande ", None
if ("type" in part_account[0].keys()):
if part_account[0]['type']:

View File

@ -711,13 +711,16 @@ def Pro_Account_Token_Pass(account_mail, my_token, my_tmp_pwd):
Pour vous connecter et profiter de nos services, voici vos identifiants :
<p>
Votre mot de passe temporaire : {tmp_pwd}<br> &nbsp;&nbsp;
<i>Nous vous recommandons de changer ce mot de passe apres la première connection.</i>
<li>
Email de connexion : l'email de connexion correspond à l'adresse de cette boite email.
</li>
<li>
<li>Votre mot de passe temporaire : {tmp_pwd}<br> &nbsp;&nbsp;
<i>Nous vous recommandons de changer ce mot de passe apres la première connection.</i>
</li>
<li>
Votre clé secrète : {cle} </li>
<li>
</li>
<li>
url de connexion : https://www.mysy-training.com/PartnerLogin
</li>

View File

@ -505,7 +505,7 @@ def valide_partnair_account(value):
if (result):
url = 'https://www.mysy-training.com/PartnerLogin0/'
url = 'http://localhost:3009/PartnerLogin0'
#url = 'http://localhost:3009/PartnerLogin0'
else:
url = 'https://www.mysy-training.com/erreur'

View File

@ -574,11 +574,21 @@ La modification ne s'effectue que si le compte n'est pas verrouillé.
'''
def valide_partnair_account(value):
try:
client = MongoClient(CONNECTION_STRING)
dbname = client['cherifdb']
coll_name = MYSY_GV.dbname['partnair_account']
tmp = coll_name.find({'_id':ObjectId(str(value))})
tmp_count = coll_name.count_documents({'_id':ObjectId(str(value)), 'active':'1'})
if (tmp_count > 0):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Ce compte a deja été activé")
return False, "Ce compte a deja été activé "
tmp = coll_name.find({'_id':ObjectId(str(value)), 'active':'0'})
if( tmp.count() <= 0 ):
mycommon.myprint(str(inspect.stack()[0][3]) + " - il n'y aucun compte à activer")
return False, "Impossible de valider ce compte "
partner_email = tmp[0]['email']
@ -927,17 +937,29 @@ def UpgradetoPro(diction):
if x['email']:
new_diction['contact_mail'] = x['email']
if x['last_name']:
new_diction['contact_nom'] = x['last_name']
if ("last_name" in x.keys()):
if x['last_name']:
new_diction['contact_nom'] = x['last_name']
if x['surname']:
new_diction['contact_prenom'] = x['surname']
if ("surname" in x.keys()):
if x['surname']:
new_diction['contact_prenom'] = x['surname']
if x['mob_phone']:
new_diction['contact_tel'] = x['mob_phone']
if ("mob_phone" in x.keys()):
if x['mob_phone']:
new_diction['contact_tel'] = x['mob_phone']
print(" new_diction la = "+str(new_diction))
'''
Verification que cette adresse email n'hesiste pas deja dans
'''
check_tmp = coll_user_account.count_documents({'email': str(diction['email'])})
if (check_tmp < 0):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Ce compte partenaire existe deja")
return False, "Ce compte partenaire existe deja"
status, retval = add_partner_account(new_diction)
if( status ):