28/07/23 - 19h

master
cherif 2023-07-28 19:44:11 +02:00
parent 220951b7c2
commit 42c0ec167e
3 changed files with 2021 additions and 19 deletions

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="26/07/23 - 23h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="27/07/23 - 23h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Contact.py" beforeDir="false" afterPath="$PROJECT_DIR$/Contact.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -70,13 +68,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00004" summary="10/04/23 - 17h">
<created>1681138622687</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1681138622687</updated>
</task>
<task id="LOCAL-00005" summary="14/04/23 - 23h">
<created>1681505500999</created>
<option name="number" value="00005" />
@ -413,7 +404,14 @@
<option name="project" value="LOCAL" />
<updated>1690405587654</updated>
</task>
<option name="localTasksCounter" value="53" />
<task id="LOCAL-00053" summary="27/07/23 - 23h">
<created>1690491310678</created>
<option name="number" value="00053" />
<option name="presentableId" value="LOCAL-00053" />
<option name="project" value="LOCAL" />
<updated>1690491310679</updated>
</task>
<option name="localTasksCounter" value="54" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -428,7 +426,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="28/05/23 - 15h" />
<MESSAGE value="29/0523 - 20h" />
<MESSAGE value="30/05/23 - 22h" />
<MESSAGE value="02/06/23 - 22h" />
@ -453,6 +450,7 @@
<MESSAGE value="24/07/23 - 17h" />
<MESSAGE value="25/07/23 - 21h" />
<MESSAGE value="26/07/23 - 23h" />
<option name="LAST_COMMIT_MESSAGE" value="26/07/23 - 23h" />
<MESSAGE value="27/07/23 - 23h" />
<option name="LAST_COMMIT_MESSAGE" value="27/07/23 - 23h" />
</component>
</project>

View File

@ -53,7 +53,8 @@ def Add_Contact(diction):
field_list = ['token', "raison_sociale", "nom", "siret", "tva", "email",
"telephone", "website", "comment",'adr_adresse', 'adr_code_postal',
'adr_ville', 'adr_pays', 'type', 'telephone_mobile', 'linkedin',
'facebook', 'twitter', 'related_collection', 'related_collection_owner_email', ]
'facebook', 'twitter', 'related_collection', 'related_collection_owner_email',
'prenom']
incom_keys = diction.keys()
for val in incom_keys:
@ -141,6 +142,12 @@ def Add_Contact(diction):
siret = diction['siret']
data['siret'] = diction['siret']
prenom = ""
if ("prenom" in diction.keys()):
if diction['prenom']:
prenom = diction['prenom']
data['prenom'] = diction['prenom']
adr_adresse = ""
if ("adr_adresse" in diction.keys()):
if diction['adr_adresse']:
@ -280,7 +287,7 @@ def Add_Contact(diction):
return False, " Impossible de créer le contact "
return True, " Le client a été correctement créé"
return True, " Le contact a été correctement créé"
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
@ -621,7 +628,7 @@ def Get_Given_Contact(diction):
"""
Verification des input acceptés
"""
field_list = ['token', 'email', 'related_collection', 'related_collection_recid']
field_list = ['token', 'email', 'related_collection', 'related_collection_owner_email']
incom_keys = diction.keys()
for val in incom_keys:
@ -633,7 +640,7 @@ def Get_Given_Contact(diction):
"""
Verification des champs obligatoires
"""
field_list_obligatoire = ['token', 'email', 'related_collection', 'related_collection_recid']
field_list_obligatoire = ['token', 'email', 'related_collection', 'related_collection_owner_email']
for val in field_list_obligatoire:
if val not in diction:
mycommon.myprint(
@ -661,6 +668,16 @@ def Get_Given_Contact(diction):
mycommon.myprint(str(inspect.stack()[0][3]) + " - impossible de recuperer les données de l'utilisateur ")
return False, str(inspect.stack()[0][3]) + " - impossible de recuperer les données de l'utilisateur. "
# Recuperation du recid du related_collection_owner_email
related_collection_owner_data = MYSY_GV.dbname[str(diction['related_collection'])].find_one({'email':str(diction['related_collection_owner_email']),
'valide':'1', 'locked':'0'})
if( related_collection_owner_data is None or 'recid' not in related_collection_owner_data.keys()):
mycommon.myprint(str(inspect.stack()[0][3]) + " - related_collection_owner_email inconnu ")
return False, str(inspect.stack()[0][3]) + " - related_collection_owner_email inconnu "
"""
Clés de mise à jour
"""
@ -668,7 +685,7 @@ def Get_Given_Contact(diction):
data_cle['partner_recid'] = str(my_partner['recid'])
data_cle['email'] = str(diction['email'])
data_cle['related_collection'] = str(diction['related_collection'])
data_cle['related_collection_recid'] = str(diction['related_collection_recid'])
data_cle['related_collection_recid'] = str(related_collection_owner_data['recid'])
data_cle['valide'] = "1"
data_cle['locked'] = "0"

File diff suppressed because it is too large Load Diff