30/01/2025 - 16h

master
cherif 2025-01-30 16:37:07 +01:00
parent ef0672002c
commit e6a9ea6272
11 changed files with 18048 additions and 47 deletions

View File

@ -1,19 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="18/01/2025 - 17h"> <list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="20/01/2025 - 18h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/E_Sign_Document.py" beforeDir="false" afterPath="$PROJECT_DIR$/E_Sign_Document.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/base_partner_catalog_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_partner_catalog_config.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/ela_factures_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_factures_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/crm_opportunite.py" beforeDir="false" afterPath="$PROJECT_DIR$/crm_opportunite.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_user_account.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_user_account.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/ela_user_account.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_user_account.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" 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$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/user_message_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/user_message_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/user_session.py" beforeDir="false" afterPath="$PROJECT_DIR$/user_session.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -84,13 +83,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680804787304</updated> <updated>1680804787304</updated>
</task> </task>
<task id="LOCAL-00382" summary="dddqsdd">
<created>1724868784464</created>
<option name="number" value="00382" />
<option name="presentableId" value="LOCAL-00382" />
<option name="project" value="LOCAL" />
<updated>1724868784465</updated>
</task>
<task id="LOCAL-00383" summary="dddqsdddd"> <task id="LOCAL-00383" summary="dddqsdddd">
<created>1725013352921</created> <created>1725013352921</created>
<option name="number" value="00383" /> <option name="number" value="00383" />
@ -427,7 +419,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1737217224339</updated> <updated>1737217224339</updated>
</task> </task>
<option name="localTasksCounter" value="431" /> <task id="LOCAL-00431" summary="20/01/2025 - 18h">
<created>1737392376180</created>
<option name="number" value="00431" />
<option name="presentableId" value="LOCAL-00431" />
<option name="project" value="LOCAL" />
<updated>1737392376182</updated>
</task>
<option name="localTasksCounter" value="432" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -469,7 +468,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="12/10/204 - 18h" />
<MESSAGE value="13/10/2024 - 14h" /> <MESSAGE value="13/10/2024 - 14h" />
<MESSAGE value="13/10/2024 - sdf14h" /> <MESSAGE value="13/10/2024 - sdf14h" />
<MESSAGE value="13/10/2024 - sdfqsdqs14h" /> <MESSAGE value="13/10/2024 - sdfqsdqs14h" />
@ -494,6 +492,7 @@
<MESSAGE value="16/01/2025 - 16h30" /> <MESSAGE value="16/01/2025 - 16h30" />
<MESSAGE value="17/01/2025 - 15:30" /> <MESSAGE value="17/01/2025 - 15:30" />
<MESSAGE value="18/01/2025 - 17h" /> <MESSAGE value="18/01/2025 - 17h" />
<option name="LAST_COMMIT_MESSAGE" value="18/01/2025 - 17h" /> <MESSAGE value="20/01/2025 - 18h" />
<option name="LAST_COMMIT_MESSAGE" value="20/01/2025 - 18h" />
</component> </component>
</project> </project>

View File

@ -199,7 +199,7 @@ def Create_E_Document(diction):
new_diction['file_cononical_name'] = cononic_name new_diction['file_cononical_name'] = cononic_name
print(" ### new_diction aaa = ", new_diction) #print(" ### new_diction aaa = ", new_diction)
val = MYSY_GV.dbname['e_document_signe'].insert_one(new_diction) val = MYSY_GV.dbname['e_document_signe'].insert_one(new_diction)
@ -764,7 +764,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
if (str(diction['email_destinataire']) in tab_list_email): if (str(diction['email_destinataire']) in tab_list_email):
my_str = str(e_document_data['document_data']) my_str = str(e_document_data['document_data'])
document_data_as_bytes = str.encode(my_str) document_data_as_bytes = str.encode(my_str)
print(type(document_data_as_bytes)) # ensure it is byte representation #print(type(document_data_as_bytes)) # ensure it is byte representation
message = document_data_as_bytes message = document_data_as_bytes
msg = SignedMessage(message=message) msg = SignedMessage(message=message)
@ -967,7 +967,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
ts = str(ts).replace(".", "").replace(",", "")[-2:] ts = str(ts).replace(".", "").replace(",", "")[-2:]
if (str(e_docment_type).strip() != ""): if (str(e_docment_type).strip() != ""):
orig_file_name = str(e_docment_type).strip()+"_Signe_" + str(todays_date)+"_"+str(ts) + ".pdf" orig_file_name = str(e_docment_type).strip().capitalize()+"_Signe_" + str(todays_date)+"_"+str(ts) + ".pdf"
else: else:
orig_file_name = "Document_Signe_" + str(todays_date)+"_"+str(ts) + ".pdf" orig_file_name = "Document_Signe_" + str(todays_date)+"_"+str(ts) + ".pdf"
@ -1217,7 +1217,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
""" """
quotation_client_data = None quotation_client_data = None
reference_document = "" reference_document = ""
type_document = "" type_document = str(e_docment_type)
if(e_document_date_2['type'] == "quotation" ): if(e_document_date_2['type'] == "quotation" ):
qry = {'partner_owner_recid':local_partner_owner_recid, qry = {'partner_owner_recid':local_partner_owner_recid,
'_id':ObjectId(str(e_document_date_2['related_collection_id'])), '_id':ObjectId(str(e_document_date_2['related_collection_id'])),
@ -1274,8 +1274,10 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
new_file = {} new_file = {}
new_file['token'] = temp_admin_account['token'] new_file['token'] = temp_admin_account['token']
if (type_document == "Devis" and reference_document): if (type_document and reference_document):
new_file['file_business_object'] = "e_"+str(type_document)+"_"+str(reference_document)+"_signe_" + str(todays_date)+"_"+str(ts) new_file['file_business_object'] = "e_"+str(type_document)+"_"+str(reference_document)+"_signe_" + str(todays_date)+"_"+str(ts)
elif ( type_document ):
new_file['file_business_object'] = "e_" + str(type_document) + "_signe_" + str(todays_date) + "_" + str(ts)
else: else:
new_file['file_business_object'] = "e_Document_signe_" + str(todays_date)+"_"+str(ts) new_file['file_business_object'] = "e_Document_signe_" + str(todays_date)+"_"+str(ts)
@ -1304,7 +1306,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
et on valide le devis. on le met à 'gagné' et on valide le devis. on le met à 'gagné'
""" """
if (str(e_docment_type).strip() == "quotation"): if (str(e_docment_type).strip().lower() == "quotation"):
""" """
mettre le devis à gagné mettre le devis à gagné
@ -1640,7 +1642,7 @@ def Create_E_Signature_For_E_Invoice(file_img=None, Folder=None, diction=None):
ts = str(ts).replace(".", "").replace(",", "")[-2:] ts = str(ts).replace(".", "").replace(",", "")[-2:]
if (str(e_docment_type).strip() != ""): if (str(e_docment_type).strip() != ""):
orig_file_name = str(e_docment_type).strip() + "_Signe_" + str(todays_date) + "_" + str(ts) + ".pdf" orig_file_name = str(e_docment_type).strip().capitalize() + "_Signe_" + str(todays_date) + "_" + str(ts) + ".pdf"
else: else:
orig_file_name = "Document_Signe_" + str(todays_date) + "_" + str(ts) + ".pdf" orig_file_name = "Document_Signe_" + str(todays_date) + "_" + str(ts) + ".pdf"
@ -1793,7 +1795,7 @@ def Create_E_Signature_For_E_Invoice(file_img=None, Folder=None, diction=None):
""" """
quotation_client_data = None quotation_client_data = None
reference_document = "" reference_document = ""
type_document = "" type_document = str(e_docment_type)
if (e_document_date_2['type'] == "quotation"): if (e_document_date_2['type'] == "quotation"):
qry = {'partner_owner_recid': local_partner_owner_recid, qry = {'partner_owner_recid': local_partner_owner_recid,
'_id': ObjectId(str(e_document_date_2['related_collection_id'])), '_id': ObjectId(str(e_document_date_2['related_collection_id'])),
@ -1846,9 +1848,11 @@ def Create_E_Signature_For_E_Invoice(file_img=None, Folder=None, diction=None):
new_file = {} new_file = {}
new_file['token'] = temp_admin_account['token'] new_file['token'] = temp_admin_account['token']
if (type_document == "Devis" and reference_document): if (type_document and reference_document):
new_file['file_business_object'] = "e_" + str(type_document) + "_" + str( new_file['file_business_object'] = "e_" + str(type_document) + "_" + str(
reference_document) + "_signe_" + str(todays_date) + "_" + str(ts) reference_document) + "_signe_" + str(todays_date) + "_" + str(ts)
elif (type_document):
new_file['file_business_object'] = "e_" + str(type_document) + "_signe_" + str(todays_date) + "_" + str(ts)
else: else:
new_file['file_business_object'] = "e_Document_signe_" + str(todays_date) + "_" + str(ts) new_file['file_business_object'] = "e_Document_signe_" + str(todays_date) + "_" + str(ts)
@ -1876,7 +1880,7 @@ def Create_E_Signature_For_E_Invoice(file_img=None, Folder=None, diction=None):
Si il s'agit d'un devis, alors on procede a la resevation des places Si il s'agit d'un devis, alors on procede a la resevation des places
""" """
if (str(e_docment_type).strip() == "quotation"): if (str(e_docment_type).strip().lower() == "quotation"):
""" """
Recuperer les données de la quotation Recuperer les données de la quotation

View File

@ -458,6 +458,7 @@ if (MYSY_ENV == "PROD"):
LMS_BAS_URL = "mysy-training.fr/" LMS_BAS_URL = "mysy-training.fr/"
""" """
elif (MYSY_ENV == "DEV"): elif (MYSY_ENV == "DEV"):
"""
MYSY_MARIADB_USER = "mysy_mariadb_user" MYSY_MARIADB_USER = "mysy_mariadb_user"
MYSY_MARIADB_USER_PASS = "fB5z%M)GG&g!n2c" MYSY_MARIADB_USER_PASS = "fB5z%M)GG&g!n2c"
MYSY_MARIADB_HOST = "88.170.110.220" MYSY_MARIADB_HOST = "88.170.110.220"
@ -466,6 +467,16 @@ elif (MYSY_ENV == "DEV"):
MYSY_LMS_URL = "https://lms.mysy-training.com/" MYSY_LMS_URL = "https://lms.mysy-training.com/"
MYSY_LMS_BASE_DIRECTORY = "/var/www/html/chamilo_mysy/" MYSY_LMS_BASE_DIRECTORY = "/var/www/html/chamilo_mysy/"
LMS_BAS_URL = "mysy-training.com/" LMS_BAS_URL = "mysy-training.com/"
"""
MYSY_MARIADB_USER = "mysy_mariadb_user"
MYSY_MARIADB_USER_PASS = "fB5z%M)GG&g!n2c"
MYSY_MARIADB_HOST = "192.168.1.21"
MYSY_MARIADB_PORT = 3306
MYSY_LMS_BDD = "mysy_db_chamilo_rec"
MYSY_LMS_URL = "https://reclms.mysy-training.com/"
MYSY_LMS_BASE_DIRECTORY = "/var/www/html/chamilo_mysy_rec/"
LMS_BAS_URL = "mysy-hosting.com/"
MYSY_ENV_API = "http://localhost:"+str(MYSY_PORT_DEV)+"/myclass/api/" MYSY_ENV_API = "http://localhost:"+str(MYSY_PORT_DEV)+"/myclass/api/"

View File

@ -3718,7 +3718,7 @@ def Controle_AddStagiairetoClass_mass_for_many_session(saved_file=None, Folder=N
mysession_count_qry = {'class_internal_url': str(myclass_data['internal_url']), 'valide': '1', mysession_count_qry = {'class_internal_url': str(myclass_data['internal_url']), 'valide': '1',
'partner_owner_recid': str(partner_recid), 'code_session':str(df['code_session'].values[n]) } 'partner_owner_recid': str(partner_recid), 'code_session':str(df['code_session'].values[n]) }
print(" ### mysession_count_qry = ", mysession_count_qry) #print(" ### mysession_count_qry = ", mysession_count_qry)
mysession_count = MYSY_GV.dbname['session_formation'].count_documents(mysession_count_qry) mysession_count = MYSY_GV.dbname['session_formation'].count_documents(mysession_count_qry)

File diff suppressed because one or more lines are too long

View File

@ -609,8 +609,8 @@ def createOrder(diction):
if( local_status is False): if( local_status is False):
mycommon.myprint( mycommon.myprint(
str(inspect.stack()[0][ str(inspect.stack()[0][
3]) + " la valeur du remise n'est pas correcte ") 3]) + " La valeur de la remise n'est pas correcte ")
return False, "la valeur du remise n'est pas correcte ", None return False, "La valeur de la remise n'est pas correcte ", None
local_status, local_discount_qty = mycommon.IsInt(discount_qty) local_status, local_discount_qty = mycommon.IsInt(discount_qty)
if (local_status is False): if (local_status is False):

View File

@ -1832,7 +1832,7 @@ def InitUserPasswd(diction):
coll_name = MYSY_GV.dbname['partnair_account'] coll_name = MYSY_GV.dbname['partnair_account']
print(" #### myquery partenaire ="+str(myquery)) #print(" #### myquery partenaire ="+str(myquery))
tmp = coll_name.count_documents(myquery) tmp = coll_name.count_documents(myquery)
if (tmp <= 0): if (tmp <= 0):
@ -1841,7 +1841,7 @@ def InitUserPasswd(diction):
retVal = coll_name.find(myquery, {"_id": 0, "valide": 0,}) retVal = coll_name.find(myquery, {"_id": 0, "valide": 0,})
print(" ### retVal 001 = ", str(retVal[0])) #print(" ### retVal 001 = ", str(retVal[0]))
""" """
Dans le cas exclusif du compte pro, Dans le cas exclusif du compte pro,
@ -1857,7 +1857,7 @@ def InitUserPasswd(diction):
new_token['active'] = "1" new_token['active'] = "1"
new_token['email'] = str(myemail) new_token['email'] = str(myemail)
print(" ### str(retVal[0]['recid']) = ", str(retVal[0]['recid'])) #print(" ### str(retVal[0]['recid']) = ", str(retVal[0]['recid']))
ret_val = coll_name.find_one_and_update( ret_val = coll_name.find_one_and_update(
{'recid': str(retVal[0]['recid']), }, {'recid': str(retVal[0]['recid']), },
@ -1885,19 +1885,19 @@ def InitUserPasswd(diction):
if ("_id" not in ret_val_tmp.keys()): if ("_id" not in ret_val_tmp.keys()):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de créer le nouveau token") mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de créer le nouveau token")
return True, "La demande de reinitiation à été prise en compte" return True, "La demande de réinitialisation à été prise en compte"
# Account type 2 is for PRO customers # Account type 2 is for PRO customers
account_type = 2 account_type = 2
email_mgt.send_user_init_pwd_mail(mynewtoken, retVal[0]['email'],account_type ) email_mgt.send_user_init_pwd_mail(mynewtoken, retVal[0]['email'],account_type )
return True, "La demande de reinitiation à été prise en compte" return True, "La demande de réinitialisation à été prise en compte"
except Exception as e: except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info() 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)) mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
return False, "Impossible de reinitialiser le mot de passe de l'utiilisateur" return False, "Impossible de réinitialiser le mot de passe"
''' '''

View File

@ -189,6 +189,8 @@ def Create_MySy_LMS_User(diction):
hashed_pwd = hashed_pwd.decode("UTF-8") hashed_pwd = hashed_pwd.decode("UTF-8")
print(" ### CLAIRE PWD = ", password)
print(" ### hashed_pwd PWD = ", hashed_pwd)
if (retval is None or "current_val" not in retval.keys()): if (retval is None or "current_val" not in retval.keys()):
mycommon.myprint(" Impossible de récupérer la sequence 'mysy_sequence' ") mycommon.myprint(" Impossible de récupérer la sequence 'mysy_sequence' ")

12
main.py
View File

@ -1612,7 +1612,7 @@ Cette API retourne les formations par metier
def get_class_by_metier(): def get_class_by_metier():
# On recupere le corps (payload) de la requete # On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict()) payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ", payload) print(" ### get_class_by_metier payload = ", payload)
status, result = cm.get_class_by_metier(payload) status, result = cm.get_class_by_metier(payload)
return jsonify(status=status, message=result) return jsonify(status=status, message=result)
@ -1651,7 +1651,7 @@ Cette API recupere les facture d'un client en prenant son tokek
def get_invoice_by_customer(): def get_invoice_by_customer():
# On recupere le corps (payload) de la requete # On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict()) payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ", payload) print(" ### get_invoice_by_customer payload = ", payload)
status, result = invoice.get_invoice_by_customer(payload) status, result = invoice.get_invoice_by_customer(payload)
return jsonify(status=status, message=result) return jsonify(status=status, message=result)
@ -1665,7 +1665,7 @@ retournés
def get_product_service(): def get_product_service():
# On recupere le corps (payload) de la requete # On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict()) payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ", payload) print(" ### get_product_service payload = ", payload)
status, result = PS.get_product_service(payload) status, result = PS.get_product_service(payload)
return jsonify(status=status, message=result) return jsonify(status=status, message=result)
@ -1678,7 +1678,7 @@ Cette API rengristre un mode depayment (CB ou SEPA)
def add_payement_mode(): def add_payement_mode():
# On recupere le corps (payload) de la requete # On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict()) payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ", payload) print(" ### add_payement_mode payload = ", payload)
status, result = invoice.add_payement_mode(payload) status, result = invoice.add_payement_mode(payload)
return jsonify(status=status, message=result) return jsonify(status=status, message=result)
@ -1703,7 +1703,7 @@ Cette API recupere les données et crée la commande
def createOrder(): def createOrder():
# On recupere le corps (payload) de la requete # On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict()) payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ", str(payload)) print(" ### createOrder payload = ", str(payload))
status, message, order_id = invoice.createOrder(payload) status, message, order_id = invoice.createOrder(payload)
return jsonify(status=status, message=message, order_id=order_id) return jsonify(status=status, message=message, order_id=order_id)
@ -1715,7 +1715,7 @@ Cette API retourne la liste des mots suggerés pour la recherche
def Get_Suggested_Word(): def Get_Suggested_Word():
# On recupere le corps (payload) de la requete # On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict()) payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### payload = ", str(payload)) print(" ### Get_Suggested_Word payload = ", str(payload))
status, message = mycommon.Get_Suggested_Word() status, message = mycommon.Get_Suggested_Word()
return jsonify(status=status, message=message) return jsonify(status=status, message=message)

View File

@ -1318,6 +1318,9 @@ def Get_Partner_List_Partner_Client(diction):
if ("is_prospect" not in retval.keys()): if ("is_prospect" not in retval.keys()):
user['is_prospect'] = "" user['is_prospect'] = ""
if ("intranet_account_id" not in retval.keys()):
user['intranet_account_id'] = ""
val_tmp = val_tmp + 1 val_tmp = val_tmp + 1
RetObject.append(mycommon.JSONEncoder().encode(user)) RetObject.append(mycommon.JSONEncoder().encode(user))
@ -1418,7 +1421,7 @@ def Get_Partner_List_Partner_Client_with_filter_Like(diction):
} }
print("#### Get_Partner_List_Partner_Client_with_filter_Like laa 01 : query = ", qry) #print("#### Get_Partner_List_Partner_Client_with_filter_Like laa 01 : query = ", qry)
RetObject = [] RetObject = []
val_tmp = 1 val_tmp = 1
@ -1441,6 +1444,9 @@ def Get_Partner_List_Partner_Client_with_filter_Like(diction):
if( "is_prospect" not in New_retVal.keys() ): if( "is_prospect" not in New_retVal.keys() ):
user['is_prospect'] = "" user['is_prospect'] = ""
if ("intranet_account_id" not in New_retVal.keys()):
user['intranet_account_id'] = ""
RetObject.append(mycommon.JSONEncoder().encode(user)) RetObject.append(mycommon.JSONEncoder().encode(user))
return True, RetObject return True, RetObject
@ -1553,6 +1559,12 @@ def Get_Given_Partner_Client(diction):
if ("type_pouvoir_public_id" not in retval.keys()): if ("type_pouvoir_public_id" not in retval.keys()):
user['type_pouvoir_public_id'] = "" user['type_pouvoir_public_id'] = ""
if ("is_prospect" not in retval.keys()):
user['is_prospect'] = ""
if ("intranet_account_id" not in retval.keys()):
user['intranet_account_id'] = ""
RetObject.append(mycommon.JSONEncoder().encode(user)) RetObject.append(mycommon.JSONEncoder().encode(user))
#print(" ### RetObject = ", RetObject) #print(" ### RetObject = ", RetObject)
@ -1662,6 +1674,12 @@ def Get_Given_Partner_Client_From_Id(diction):
if ("type_pouvoir_public_id" not in retval.keys()): if ("type_pouvoir_public_id" not in retval.keys()):
user['type_pouvoir_public_id'] = "" user['type_pouvoir_public_id'] = ""
if ("is_prospect" not in retval.keys()):
user['is_prospect'] = ""
if ("intranet_account_id" not in retval.keys()):
user['intranet_account_id'] = ""
RetObject.append(mycommon.JSONEncoder().encode(user)) RetObject.append(mycommon.JSONEncoder().encode(user))
#print(" ### RetObject = ", RetObject) #print(" ### RetObject = ", RetObject)
@ -2037,6 +2055,8 @@ def Get_Client_Type_List(diction):
if ("is_prospect" not in retval.keys()): if ("is_prospect" not in retval.keys()):
user['is_prospect'] = "" user['is_prospect'] = ""
if ("intranet_account_id" not in retval.keys()):
user['intranet_account_id'] = ""
val_tmp = val_tmp + 1 val_tmp = val_tmp + 1
RetObject.append(mycommon.JSONEncoder().encode(user)) RetObject.append(mycommon.JSONEncoder().encode(user))

View File

@ -120,12 +120,22 @@ def add_user_message(diction):
if ("object" in diction.keys()): if ("object" in diction.keys()):
if diction['object']: if diction['object']:
new_diction['object'] = diction['object'] new_diction['object'] = diction['object']
if (len(str(diction['message'])) > 300):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - L'objet du message doit faire moins de 300 caractères")
return False, "Le sujet doit faire moins de 300 caractères"
if ("message" in diction.keys()): if ("message" in diction.keys()):
if diction['message']: if diction['message']:
new_diction['message'] = diction['message'] new_diction['message'] = diction['message']
if(len(str(diction['message'])) > 1500):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - Le message doit faire moins de 1500 caractères")
return False, "Le message doit faire moins de 1500 caractères"
if ("user_ip" in diction.keys()): if ("user_ip" in diction.keys()):
if diction['user_ip']: if diction['user_ip']:
new_diction['user_ip'] = diction['user_ip'] new_diction['user_ip'] = diction['user_ip']
@ -177,16 +187,16 @@ def add_user_message(diction):
if ret_val and ret_val.inserted_id: if ret_val and ret_val.inserted_id:
nb_doc = ret_val.inserted_id nb_doc = ret_val.inserted_id
mycommon.myprint(" Le message a été bien enregistrée. Id message = '" + str(nb_doc) + "' ") mycommon.myprint(" Le message a été bien enregistré. Id message = '" + str(nb_doc) + "' ")
return True, "Le message a été bien enregistrée" return True, "Le message a été bien enregistré"
else: else:
return False, "Impossible d'ajouter le message" return False, "Impossible d'enregistrer le message (2) "
except Exception as e: except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info() 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)) mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
return False, "Impossible d'ajouter le message" return False, "Impossible d'enregistrer le message"