07/08/22 - 14h30
parent
b10e25eb7d
commit
99fb1ddd77
|
@ -91,3 +91,8 @@ def get_invoice_by_customer(diction):
|
|||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, "Impossible de recuperer les factures"
|
||||
|
||||
|
||||
'''
|
||||
Cette API recupere les infos de facturation d'un client
|
||||
'''
|
|
@ -711,13 +711,14 @@ def Pro_Account_Token_Pass(account_mail, my_token, my_tmp_pwd):
|
|||
Pour vous connecter et profiter de nos services, voici vos identifiants :
|
||||
<p>
|
||||
|
||||
<li>
|
||||
Votre clé secrète : {cle} </li>
|
||||
<li>
|
||||
|
||||
Votre mot de passe temporaire : {tmp_pwd}<br>
|
||||
<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>
|
||||
url de connexion : https://www.mysy-training.com/PartnerLogin
|
||||
</li>
|
||||
|
||||
|
|
69
partners.py
69
partners.py
|
@ -57,7 +57,7 @@ def add_partner_account(diction):
|
|||
# field_list.
|
||||
'''
|
||||
field_list = ['nom', 'adr_street', 'adr_city', 'adr_zip', 'adr_country','link_linkedin','link_facebook','link_twitter',
|
||||
'email','pwd', 'telephone','contact_nom','contact_prenom','contact_tel','contact_mail']
|
||||
'email','pwd', 'telephone','contact_nom','contact_prenom','contact_tel','contact_mail', 'pack_service']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -77,33 +77,43 @@ def add_partner_account(diction):
|
|||
|
||||
# recuperation des paramettre
|
||||
mydata = {}
|
||||
|
||||
mydata['invoice_vat_num'] = ""
|
||||
|
||||
if ("nom" in diction.keys()):
|
||||
if diction['nom']:
|
||||
mydata['nom'] = diction['nom']
|
||||
mydata['invoice_nom'] = diction['nom']
|
||||
|
||||
if ("adr_street" in diction.keys()):
|
||||
if diction['adr_street']:
|
||||
mydata['adr_street'] = diction['adr_street']
|
||||
mydata['invoice_adr_street'] = diction['adr_street']
|
||||
|
||||
if ("adr_city" in diction.keys()):
|
||||
if diction['adr_city']:
|
||||
mydata['adr_city'] = diction['adr_city']
|
||||
mydata['invoice_adr_city'] = diction['adr_city']
|
||||
|
||||
if ("adr_zip" in diction.keys()):
|
||||
if diction['adr_zip']:
|
||||
mydata['adr_zip'] = diction['adr_zip']
|
||||
mydata['invoice_adr_zip'] = diction['adr_zip']
|
||||
|
||||
if ("adr_country" in diction.keys()):
|
||||
if diction['adr_country']:
|
||||
mydata['adr_country'] = diction['adr_country']
|
||||
mydata['invoice_adr_country'] = diction['adr_country']
|
||||
|
||||
if ("email" in diction.keys()):
|
||||
if diction['email']:
|
||||
mydata['email'] = diction['email']
|
||||
mydata['invoice_email'] = diction['email']
|
||||
|
||||
if ("telephone" in diction.keys()):
|
||||
if diction['telephone']:
|
||||
mydata['telephone'] = diction['telephone']
|
||||
mydata['invoice_telephone'] = diction['telephone']
|
||||
|
||||
if ("pwd" in diction.keys()):
|
||||
if diction['pwd']:
|
||||
|
@ -137,6 +147,11 @@ def add_partner_account(diction):
|
|||
if diction['link_twitter']:
|
||||
mydata['link_twitter'] = diction['link_twitter']
|
||||
|
||||
if ("pack_service" in diction.keys()):
|
||||
if diction['pack_service']:
|
||||
mydata['pack_service'] = diction['pack_service']
|
||||
|
||||
|
||||
# Creation du RecId du user
|
||||
mydata['recid'] = mycommon.create_user_recid()
|
||||
|
||||
|
@ -386,7 +401,9 @@ def update_partner_account(diction):
|
|||
'''
|
||||
field_list = ['nom', 'adr_street', 'adr_city', 'adr_zip', 'adr_country', 'link_linkedin',
|
||||
'email', 'pwd', 'telephone', 'contact_nom', 'contact_prenom', 'contact_tel',
|
||||
'contact_mail', 'token', 'link_facebook', 'link_twitter']
|
||||
'contact_mail', 'token', 'link_facebook', 'link_twitter', 'invoice_vat_num',
|
||||
'invoice_nom', 'invoice_adr_street', 'invoice_adr_city', 'invoice_adr_zip',
|
||||
'invoice_adr_country', 'invoice_email', 'invoice_telephone', 'invoice_vat_num']
|
||||
incom_keys = diction.keys()
|
||||
|
||||
|
||||
|
@ -410,8 +427,8 @@ def update_partner_account(diction):
|
|||
my_token = ""
|
||||
|
||||
|
||||
if ("nom" in diction.keys()):
|
||||
if diction['nom']:
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
my_token = diction['token']
|
||||
|
||||
|
||||
|
@ -488,6 +505,39 @@ def update_partner_account(diction):
|
|||
if diction['link_twitter']:
|
||||
mydata['link_twitter'] = diction['link_twitter']
|
||||
|
||||
if ("invoice_vat_num" in diction.keys()):
|
||||
if diction['invoice_vat_num']:
|
||||
mydata['invoice_vat_num'] = diction['invoice_vat_num']
|
||||
|
||||
if ("invoice_nom" in diction.keys()):
|
||||
if diction['invoice_nom']:
|
||||
mydata['invoice_nom'] = diction['invoice_nom']
|
||||
|
||||
if ("invoice_adr_street" in diction.keys()):
|
||||
if diction['invoice_adr_street']:
|
||||
mydata['invoice_adr_street'] = diction['invoice_adr_street']
|
||||
|
||||
if ("invoice_adr_city" in diction.keys()):
|
||||
if diction['invoice_adr_city']:
|
||||
mydata['invoice_adr_city'] = diction['invoice_adr_city']
|
||||
|
||||
if ("invoice_adr_zip" in diction.keys()):
|
||||
if diction['invoice_adr_zip']:
|
||||
mydata['invoice_adr_zip'] = diction['invoice_adr_zip']
|
||||
|
||||
if ("invoice_adr_zip" in diction.keys()):
|
||||
if diction['invoice_adr_country']:
|
||||
mydata['invoice_adr_country'] = diction['invoice_adr_country']
|
||||
|
||||
if ("invoice_email" in diction.keys()):
|
||||
if diction['invoice_email']:
|
||||
mydata['invoice_email'] = diction['invoice_adr_zip']
|
||||
|
||||
if ("invoice_telephone" in diction.keys()):
|
||||
if diction['invoice_telephone']:
|
||||
mydata['invoice_telephone'] = diction['invoice_telephone']
|
||||
|
||||
|
||||
|
||||
mydata['date_update'] = str(datetime.now())
|
||||
|
||||
|
@ -769,7 +819,8 @@ etape 2 : Desactivation du compte utilisateur
|
|||
def UpgradetoPro(diction):
|
||||
try:
|
||||
field_list = ['token', 'nom', 'adr_street', 'adr_city', 'adr_zip', 'adr_country', 'link_linkedin', 'link_facebook',
|
||||
'link_twitter', 'email', 'pwd', 'telephone', 'contact_nom', 'contact_prenom', 'contact_tel', 'contact_mail']
|
||||
'link_twitter', 'email', 'pwd', 'telephone', 'contact_nom', 'contact_prenom', 'contact_tel',
|
||||
'contact_mail', 'pack_service']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
|
@ -781,7 +832,8 @@ def UpgradetoPro(diction):
|
|||
Une fois qu'on a controlé que toutes les clés mise dans l'API sont correcte. etape precedente,
|
||||
On controle que les champs obligatoires sont presents dans la liste
|
||||
'''
|
||||
field_list_obligatoire = ['token', 'nom', 'adr_street', 'adr_city', 'adr_zip', 'adr_country', 'email', 'telephone']
|
||||
field_list_obligatoire = ['token', 'nom', 'adr_street', 'adr_city', 'adr_zip', 'adr_country',
|
||||
'email', 'telephone', 'pack_service']
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
@ -853,6 +905,11 @@ def UpgradetoPro(diction):
|
|||
if diction['telephone']:
|
||||
new_diction['telephone'] = diction['telephone']
|
||||
|
||||
|
||||
if ("pack_service" in diction.keys()):
|
||||
if diction['pack_service']:
|
||||
new_diction['pack_service'] = diction['pack_service']
|
||||
|
||||
'''
|
||||
Create default pwd for new account
|
||||
'''
|
||||
|
|
|
@ -197,6 +197,8 @@ donc la table partner_token
|
|||
'''
|
||||
def check_partner_token_validity(email="", token=""):
|
||||
try :
|
||||
|
||||
#print(" check_partner_token_validity : Token = "+token)
|
||||
coll_token = MYSY_GV.dbname['partner_token']
|
||||
tmp_count = coll_token.count_documents({ 'token': str(token), 'locked':'0', 'valide': '1'})
|
||||
|
||||
|
|
Loading…
Reference in New Issue