21/04/22 - 16h30
parent
7c6bcd0bf0
commit
8ce16ed6b0
|
@ -192,7 +192,10 @@ def get_articles_avis(diction):
|
|||
|
||||
for x in coll_name.find({'valide': '1', 'locked': '0', 'title_formation':my_title_formation},
|
||||
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0, "indexed_title": 0,
|
||||
"valide": 0, "locked": 0, "url_formation": 0, }).sort([("title_formation",pymongo.ASCENDING), ("date_avis",pymongo.ASCENDING)]) :
|
||||
"valide": 0, "locked": 0, "url_formation": 0, }).sort([("title_formation",pymongo.ASCENDING),
|
||||
("date_avis",pymongo.ASCENDING),
|
||||
("note", pymongo.DESCENDING),
|
||||
]) :
|
||||
|
||||
user = x
|
||||
insertObject.append(JSONEncoder().encode(user))
|
||||
|
@ -225,7 +228,7 @@ def add_articles_avis(diction):
|
|||
'''
|
||||
field_list = ['token', 'title_formation', 'user_ip', 'user_country_code', 'user_country_name',
|
||||
'user_city', 'user_postal', 'user_latitude', 'user_longitude', 'user_state',
|
||||
'type_formation', 'qualite', 'avis', 'note',
|
||||
'type_formation', 'qualite', 'avis', 'note', 'qualityrating','avisrating',
|
||||
'comment', 'postedby', 'url_formation', 'user_recid']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -349,6 +352,14 @@ def add_articles_avis(diction):
|
|||
if diction['url_formation']:
|
||||
mydata['url_formation'] = diction['url_formation']
|
||||
|
||||
if ("avisrating" in diction.keys()):
|
||||
if diction['avisrating']:
|
||||
mydata['avisrating'] = diction['avisrating']
|
||||
|
||||
if ("qualityrating" in diction.keys()):
|
||||
if diction['qualityrating']:
|
||||
mydata['qualityrating'] = diction['qualityrating']
|
||||
|
||||
mydata['valide'] = '0'
|
||||
mydata['locked'] = '1'
|
||||
mydata['indexed'] = '0'
|
||||
|
@ -663,7 +674,7 @@ def get_article_avis_alaune(diction):
|
|||
|
||||
for x in coll_name.find({'valide': '1', 'locked': '0', 'isalaune': '1'},
|
||||
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0, "isalaune": 0,
|
||||
"valide": 0, "locked": 0, "url_formation": 0, }).sort(
|
||||
"valide": 0, "locked": 0, }).sort(
|
||||
[("date_avis", pymongo.ASCENDING), ("title_formation", pymongo.ASCENDING)]):
|
||||
|
||||
val = x['qualite']
|
||||
|
|
|
@ -982,23 +982,30 @@ def change_uer_email(diction):
|
|||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
Cette fonction supprime le compte de utilisateur.
|
||||
Pour garder la coherence du systeme, cela revient à :
|
||||
1 - Anonyser le compte tous les champ identifiants une personne
|
||||
(['adr_street', 'adr_city', 'adr_zip', 'adr_country', 'mob_phone','link_facebook', 'link_twitter', 'token'])
|
||||
2 - Bloquer le compte
|
||||
3 - Desactiver le compte
|
||||
Pour des questions de securité, la suppression d'un compte se fait en 2 etapes :
|
||||
|
||||
etape 1 :
|
||||
Le frontoffice qui declenche l'envoie d'un email avec un token sur l'adresse mail
|
||||
du user. puis blocage du compte.
|
||||
|
||||
etape 2 :
|
||||
Lorsque le user se connecte à son mail et clique sur le lien, là les données
|
||||
sont supprimées.
|
||||
|
||||
'''
|
||||
def delete_user_account(diction):
|
||||
def send_mail_delete_user(diction):
|
||||
try:
|
||||
# Dictionnaire des champs utilisables
|
||||
field_list = ['token']
|
||||
field_list = ['token','user_ip', 'user_country_code', 'user_country_name',
|
||||
'user_city', 'user_postal', 'user_latitude', 'user_longitude', 'user_state']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
mycommon.myprint(" Le champ '" + val + "' n'existe pas, requete annulée")
|
||||
return False, " Impossible de recuperer le user account"
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
'''
|
||||
Une fois qu'on a controlé que toutes les clés mise dans l'API sont correcte. etape precedente,
|
||||
|
@ -1007,57 +1014,200 @@ def delete_user_account(diction):
|
|||
field_list_obligatoire = ['token']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(" La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Impossible de recuperer le user account"
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
# recuperation des paramettre
|
||||
token_value = ""
|
||||
user_recid = ""
|
||||
mydata = {}
|
||||
# recuperation des paramettre
|
||||
token_value = ""
|
||||
user_recid = ""
|
||||
mydata = {}
|
||||
|
||||
if diction['token']:
|
||||
token_value = diction['token']
|
||||
if diction['token']:
|
||||
token_value = diction['token']
|
||||
|
||||
# Verification de la validité du token/mail dans le cas des user en mode connecté
|
||||
if (len(str(token_value)) <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Le token est vide ")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
retval = mycommon.check_token_validity("", token_value)
|
||||
|
||||
|
||||
# Verification de la validité du token/mail dans le cas des user en mode connecté
|
||||
if (len(str(token_value)) <= 0):
|
||||
mycommon.myprint("Le token est vide")
|
||||
return False, "Le token est vide"
|
||||
if retval is False:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Le token n'est pas valide ")
|
||||
return False, "Le token n'est pas valide"
|
||||
|
||||
retval = mycommon.check_token_validity("", token_value)
|
||||
# Recuperation du recid du user
|
||||
user_recid = mycommon.get_user_recid_from_token(token_value)
|
||||
if user_recid is False:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Impossible de recuperer le recid du user ")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
if retval is False:
|
||||
mycommon.myprint("Le token n'est pas valide")
|
||||
return False, "Le token n'est pas valide"
|
||||
# Recuperation du mail du user
|
||||
user_email_from_token = mycommon.get_user_email_from_token(token_value)
|
||||
if user_email_from_token is False:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Impossible de recuperer l'adresse mail du user ")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
# Recuperation du recid du user
|
||||
user_recid = mycommon.get_user_recid_from_token(token_value)
|
||||
if user_recid is False:
|
||||
mycommon.myprint(" Impossible de recuperer le recid du user")
|
||||
return False, " Impossible de mettre à jour le mot de passe"
|
||||
# Blocage du compte.
|
||||
mydata = {}
|
||||
mydata['delete_process'] = "1"
|
||||
mydata['locked'] = "1"
|
||||
mydata['active'] = "0"
|
||||
if ("user_ip" in diction.keys()):
|
||||
if diction['user_ip']:
|
||||
mydata['delete_ip_1'] = diction['user_ip']
|
||||
|
||||
mydata['date_update'] = str(datetime.now())
|
||||
mydata['pwd'] = user_recid
|
||||
mydata['email'] = "Anonyme"
|
||||
mydata['active'] = '0'
|
||||
mydata['locked'] = '1'
|
||||
mydata['adr_street'] = "Anonyme_"+user_recid[:5]
|
||||
mydata['mob_phone'] = '0000000'
|
||||
mydata['link_facebook'] = 'Anonyme_facebook'
|
||||
mydata['link_twitter'] = 'Anonyme_twitter'
|
||||
mydata['date_update'] = str(datetime.now())
|
||||
|
||||
coll_name = dbname['user_account']
|
||||
ret_val = coll_name.find_one_and_update({'recid': str(user_recid), 'locked': '0'},
|
||||
{"$set": mydata},
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
coll_name = dbname['user_account']
|
||||
ret_val = coll_name.find_one_and_update({'recid': str(user_recid), 'locked': '0'},
|
||||
{"$set": mydata},
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
if (ret_val and ret_val['_id']):
|
||||
mycommon.myprint("Le compte utilisateur =" + str(ret_val['_id'])+" a été supprimé")
|
||||
return True, " Le compte utilisateur a bien été supprimé"
|
||||
else:
|
||||
mycommon.myprint(" Impossible de supprimer le compte utilisateur")
|
||||
return False, "Impossible de supprimer le compte utilisateur"
|
||||
if (ret_val and ret_val['_id']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Le compte utilisateur =" + str(
|
||||
ret_val['_id']) + " email de suppression envoyé ")
|
||||
|
||||
else:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Impossible de supprimer le compte utilisateur - table : user_account")
|
||||
return False, "Impossible de supprimer le compte utilisateur"
|
||||
|
||||
|
||||
# Envoie de l'email de notification
|
||||
email_mgt.send_user_delete_account(user_recid, user_email_from_token)
|
||||
|
||||
return True, "Un email vous été envoyé. connectez vous à votre adresse mail finaliser la suppression du compte."
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, "Impossible de supprimer le compte utilisateur"
|
||||
|
||||
|
||||
|
||||
'''
|
||||
Cette fonction supprime le compte de utilisateur.
|
||||
Pour garder la coherence du systeme, cela revient à :
|
||||
1 - Anonyser le compte tous les champs identifiants une personne
|
||||
(['adr_street', 'adr_city', 'adr_zip', 'adr_country', 'mob_phone','link_facebook', 'link_twitter', 'token'])
|
||||
2 - Bloquer le compte
|
||||
3 - Desactiver le compte
|
||||
4 - Anomyser les tables annexe :
|
||||
a) articles_avis
|
||||
b) user_token
|
||||
'''
|
||||
def delete_user_account(diction):
|
||||
try:
|
||||
# Dictionnaire des champs utilisables
|
||||
field_list = ['user_recid', 'user_ip', 'user_country_code', 'user_country_name',
|
||||
'user_city','user_postal', 'user_latitude', 'user_longitude', 'user_state']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
'''
|
||||
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 = ['user_recid']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
# recuperation des paramettre
|
||||
token_value = ""
|
||||
user_recid = ""
|
||||
mydata = {}
|
||||
|
||||
if diction['user_recid']:
|
||||
user_recid = diction['user_recid']
|
||||
|
||||
|
||||
# Verification de la validité du token/mail dans le cas des user en mode connecté
|
||||
if (len(str(user_recid)) <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Le recid est vide ")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
|
||||
# Recuperation du mail du user
|
||||
print(" user recid ~~~~~~~~ "+user_recid)
|
||||
user_email_from_recid = mycommon.get_user_email_from_recid(user_recid)
|
||||
if user_email_from_recid is False:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Impossible de recuperer l'adresse mail du user ")
|
||||
return False, " Impossible de supprimer le compte utilisateur"
|
||||
|
||||
|
||||
mydata['date_update'] = str(datetime.now())
|
||||
mydata['pwd'] = user_recid
|
||||
mydata['email'] = "Anonyme@"+user_recid[:5]
|
||||
mydata['last_name'] = "name_"+user_recid[:5]
|
||||
mydata['surname'] = "surname"+user_recid[:5]
|
||||
mydata['active'] = '0'
|
||||
mydata['locked'] = '1'
|
||||
mydata['adr_street'] = "Anonyme_"+user_recid[:5]
|
||||
mydata['mob_phone'] = '0000000'
|
||||
mydata['link_facebook'] = 'Anonyme_facebook'
|
||||
mydata['link_twitter'] = 'Anonyme_twitter'
|
||||
mydata['link_linkedin'] = 'Anonyme_linkedin'
|
||||
mydata['delete_process'] = "2"
|
||||
if ("user_ip" in diction.keys()):
|
||||
if diction['user_ip']:
|
||||
mydata['delete_ip_1'] = diction['user_ip']
|
||||
|
||||
|
||||
coll_name = dbname['user_account']
|
||||
ret_val = coll_name.find_one_and_update({'recid': str(user_recid), 'locked': '0'},
|
||||
{"$set": mydata},
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
if (ret_val and ret_val['_id']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Le compte utilisateur =" + str(ret_val['_id'])+" a été supprimé de la table : user_account ")
|
||||
|
||||
else:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de supprimer le compte utilisateur - table : user_account")
|
||||
return False, "Impossible de supprimer le compte utilisateur"
|
||||
|
||||
# Anonymisation de la table user_token ou se trouve aussi l'adresse email.
|
||||
# table : user_token
|
||||
user_token_coll_name = dbname['user_token']
|
||||
ret_val = user_token_coll_name.update_many({'recid': str(user_recid), },
|
||||
{"$set": {'email':'Anonyme',
|
||||
'valide':'0',
|
||||
'date_update':str(datetime.now()) } },
|
||||
)
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Table : user_token : "+str(ret_val.matched_count)+" ont été trouvées "
|
||||
" "+str(ret_val.acknowledged)+" ont été modifiées")
|
||||
|
||||
# table : articles_avis
|
||||
articles_avis_coll_name = dbname['articles_avis']
|
||||
ret_val = articles_avis_coll_name.update_many({'postedby': str(user_email_from_recid), },
|
||||
{"$set": {'email': 'Anonyme',
|
||||
'date_update':str(datetime.now()) }},
|
||||
)
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - Table : user_token : " + str(ret_val.matched_count) + " ont été trouvées "
|
||||
" "+str(ret_val.acknowledged) + " ont été modifiées")
|
||||
|
||||
|
||||
return True, "Le compte utilisateur a bien ete supprimé"
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
|
99
email_mgt.py
99
email_mgt.py
|
@ -197,8 +197,6 @@ def send_partner_account_mail(message, account_mail):
|
|||
'''
|
||||
Envoie de l'email de reinitialisation du mot de passe du user
|
||||
'''
|
||||
|
||||
|
||||
def send_user_init_pwd_mail(token, account_mail):
|
||||
try:
|
||||
tomorrow = datetime.date.today() + datetime.timedelta(days=1)
|
||||
|
@ -234,12 +232,12 @@ def send_user_init_pwd_mail(token, account_mail):
|
|||
|
||||
<br/>
|
||||
<div style="background-color:#1962AB;width:20%;text-align:center;margin-left:auto; margin-right:auto;">
|
||||
<b> <a href="https://dev.mysy-training.com//ResetUserPwd/{objId}" target="_blank" style="color: white;">
|
||||
<b> <a href="https://dev.mysy-training.com/ResetUserPwd/{objId}" target="_blank" style="color: white;">
|
||||
Changez de mot de passe
|
||||
|
||||
</a>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</font>
|
||||
<br/>
|
||||
<b>
|
||||
|
@ -286,3 +284,96 @@ def send_user_init_pwd_mail(token, account_mail):
|
|||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible d'envoyer l'email de notification "
|
||||
|
||||
|
||||
'''
|
||||
Envoie de l'email de suppression du compte utilisateur
|
||||
'''
|
||||
|
||||
|
||||
def send_user_delete_account(token, account_mail):
|
||||
try:
|
||||
tomorrow = datetime.date.today() + datetime.timedelta(days=1)
|
||||
tomorrow_day = tomorrow.strftime("%A")
|
||||
|
||||
msg = MIMEMultipart("alternative")
|
||||
|
||||
msg['Subject'] = '[MySy Training] : Suppression de votre'
|
||||
msg['From'] = 'billardman01@hotmail.com'
|
||||
msg['To'] = str(account_mail)
|
||||
|
||||
html = '''
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div style="background-color:#eee;padding:0px;text-align:center;width:100%">
|
||||
<h2 style="font-family:Georgia, 'Times New Roman', Times, serif;color#454349;">
|
||||
<img src="http://88.170.110.220/img/MYSY-LOGO-BLUE.png" alt="Mysy Training Logo" width="110px" height="70px"/> </h2>
|
||||
</div>
|
||||
<div style="padding:20px 0px;text-align:center;font-family:Georgia, 'Times New Roman', Times, serif;color#454349;font-size:2rem;">
|
||||
<div style="width:100%">
|
||||
<div style="text-align:center;">
|
||||
Bonjour
|
||||
<div style="padding:20px 0px;text-align:center;font-family:Georgia, 'Times New Roman', Times, serif;color#454349;font-size:1.2rem;">
|
||||
|
||||
Nous avons reçu une demande de suppression de votre compte <font color="green">MySy-Training</font>.<br/>
|
||||
Si vous n'etes pas l'auteur de la demande, merci de contacter le service support de MySy.
|
||||
. <br/>
|
||||
Le échéant, vous pouvez finaliser la suppression de votre compte en cliquant sur le lien ci-dessous.<br/>
|
||||
|
||||
<font color="red">Important : Cette action entrenerait la suppresion definitive de vos information.</font>
|
||||
<br/>
|
||||
<div style="background-color:#1962AB;width:20%;text-align:center;margin-left:auto; margin-right:auto;">
|
||||
<b> <a href="https://dev.mysy-training.com/DeleteUserAccount/{objId}" target="_blank" style="color: white;">
|
||||
Changez de mot de passe
|
||||
|
||||
</a>
|
||||
</b>
|
||||
</div>
|
||||
</font>
|
||||
<br/>
|
||||
<b>
|
||||
<a href="http://localhost:3010/DeleteUserAccount/{objId}" target="_blank" style="font-size:0.5rem;" >
|
||||
CLIQUEZ ICI ==> LOCALHOST
|
||||
</b>
|
||||
</a>
|
||||
|
||||
<p>Cordialement<br>
|
||||
L'equipe informatique de MySy
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
'''.format(code=tomorrow_day, objId=token)
|
||||
|
||||
html_mime = MIMEText(html, 'html')
|
||||
|
||||
# msg.attach(texte_mime)
|
||||
msg.attach(html_mime)
|
||||
|
||||
print("html_mime =" + str(html))
|
||||
|
||||
toaddr = str(account_mail)
|
||||
cc = ['billardman01@hotmail.com']
|
||||
toaddrs = [toaddr] + cc
|
||||
|
||||
# msg.attach(MIMEText(open(filename).read()))
|
||||
|
||||
with smtplib.SMTP(smtp_address, port) as server:
|
||||
server.starttls() # Secure the connection
|
||||
|
||||
server.login(user, password)
|
||||
server.sendmail(sender, toaddrs, msg.as_string())
|
||||
mycommon.myprint("mail successfully sent to " + str(toaddrs))
|
||||
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible d'envoyer l'email de notification "
|
||||
|
|
17
main.py
17
main.py
|
@ -955,6 +955,23 @@ def Reset_user_pwd_by_token():
|
|||
status, result = eua.Reset_user_pwd_by_token(payload)
|
||||
return jsonify(status=status, message=result)
|
||||
|
||||
|
||||
|
||||
'''
|
||||
Cette API envoi l'email de suppression du compte utilisateur.
|
||||
une suppression se passe tjrs 2 phase :
|
||||
pahse 1 : envoi de l'email + blocage du compte
|
||||
pahse 2 : confirmation depuis l'email recu.
|
||||
'''
|
||||
@app.route('/myclass/api/send_mail_delete_user/', methods=['GET','POST'])
|
||||
@crossdomain(origin='*')
|
||||
def send_mail_delete_user():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = request.form.to_dict()
|
||||
print(" ### payload = ", payload)
|
||||
status, result = eua.send_mail_delete_user(payload)
|
||||
return jsonify(status=status, message=result)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(" debut api")
|
||||
|
||||
|
|
|
@ -170,6 +170,45 @@ def get_user_recid_from_token(token = ""):
|
|||
return user_recid
|
||||
|
||||
|
||||
'''
|
||||
recuperation d'email du user from token
|
||||
'''
|
||||
def get_user_email_from_token(token = ""):
|
||||
if len(str(token)) <= 0 :
|
||||
myprint(" Le token est vide")
|
||||
return False
|
||||
|
||||
coll_token = dbname['user_token']
|
||||
tmp_val = coll_token.find({'token': str(token), 'valide': '1'})
|
||||
user_email = tmp_val[0]['email']
|
||||
return user_email
|
||||
|
||||
|
||||
'''
|
||||
recuperation d'email du user from recid
|
||||
'''
|
||||
def get_user_email_from_recid(recid = ""):
|
||||
|
||||
try:
|
||||
if len(str(recid)) <= 0 :
|
||||
myprint(" Le recid est vide")
|
||||
return False
|
||||
|
||||
coll_token = dbname['user_account']
|
||||
tmp_val = coll_token.find({'recid': str(recid), 'active': '1'})
|
||||
|
||||
user_email = tmp_val[0]['email']
|
||||
return user_email
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, "Impossible de supprimer le compte utilisateur"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
recuperation du recid du partner
|
||||
|
|
Loading…
Reference in New Issue