15/09/2024 - 18:00

master
cherif 2024-09-15 18:30:43 +02:00
parent c8d17afaac
commit b0c1fb553f
20 changed files with 3601 additions and 80 deletions

View File

@ -1,13 +1,27 @@
<?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="08/09/2024 - 21terth">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="12/09/2024 - 13:00">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dashbord_queries/ressources_humaines_tbd_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/ressources_humaines_tbd_qries.py" 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$/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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" 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$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_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$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/commands/configuration.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/commands/configuration.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/commands/install.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/commands/install.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/configuration.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/configuration.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/index.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/index.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/wheel.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/pip/_internal/wheel.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/pip/_vendor/pyparsing.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/pip/_vendor/pyparsing.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/pkg_resources/_vendor/pyparsing.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/pkg_resources/_vendor/pyparsing.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/env/Lib/site-packages/setuptools/_vendor/pyparsing.py" beforeDir="false" afterPath="$PROJECT_DIR$/env/Lib/site-packages/setuptools/_vendor/pyparsing.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/note_evaluation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/note_evaluation_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -77,13 +91,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00346" summary="wwssdssd">
<created>1720553186262</created>
<option name="number" value="00346" />
<option name="presentableId" value="LOCAL-00346" />
<option name="project" value="LOCAL" />
<updated>1720553186264</updated>
</task>
<task id="LOCAL-00347" summary="wwssdssddd">
<created>1720630401945</created>
<option name="number" value="00347" />
@ -420,7 +427,14 @@
<option name="project" value="LOCAL" />
<updated>1725902258192</updated>
</task>
<option name="localTasksCounter" value="395" />
<task id="LOCAL-00395" summary="12/09/2024 - 13:00">
<created>1726138400951</created>
<option name="number" value="00395" />
<option name="presentableId" value="LOCAL-00395" />
<option name="project" value="LOCAL" />
<updated>1726138400952</updated>
</task>
<option name="localTasksCounter" value="396" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -462,7 +476,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="11/08/2024 - 18h32s" />
<MESSAGE value="dd" />
<MESSAGE value="dddss" />
<MESSAGE value="17/08/2024 - 20h55" />
@ -487,6 +500,7 @@
<MESSAGE value="06/09/2024 - 22h" />
<MESSAGE value="08/09/2024 - 21h" />
<MESSAGE value="08/09/2024 - 21terth" />
<option name="LAST_COMMIT_MESSAGE" value="08/09/2024 - 21terth" />
<MESSAGE value="12/09/2024 - 13:00" />
<option name="LAST_COMMIT_MESSAGE" value="12/09/2024 - 13:00" />
</component>
</project>

View File

@ -394,12 +394,19 @@ def Get_Given_E_Document_Not_Signed_No_Token(diction):
'secret_key_open':str(diction['secret_key_open']),
'statut':'0'}
for New_retVal in MYSY_GV.dbname['e_document_signe'].find(qry).sort([("_id", pymongo.DESCENDING), ]):
if( "email_destinataire" in New_retVal.keys() and New_retVal['email_destinataire']):
list_email = str(New_retVal['email_destinataire']).replace(",",";")
tab_list_email = list_email.split(";")
tab_list_email_tmp = list_email.split(";")
if( str(diction['user_email']) in tab_list_email ) :
tab_list_email= []
for mail in tab_list_email_tmp:
tab_list_email.append(str(mail).strip())
if( str(diction['user_email']).strip() in tab_list_email ) :
user = New_retVal
user['id'] = str(val_tmp)
if( "signature_digitale" in New_retVal.keys() ):
@ -785,6 +792,30 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
"""
Apresent que le message est signé, on va mettre à jour le doc
"""
"""
/!\ : 14/09/2024 :
On recupere d'abord l'_id du document car comme on autorise plusieurs email,
une LIKE provoque un trou de securité et n'est pas bien adaptée
"""
qry_check = {'valide': '1', 'locked': '0',
'_id': ObjectId(str(diction['e_doc_id'])),
'secret_key_signature': str(diction['secret_key_signature']),
}
my_doc = MYSY_GV.dbname['e_document_signe'].find_one(qry_check)
my_doc_email_destinataire = []
if( my_doc and "email_destinataire" in my_doc.keys() and my_doc['email_destinataire']):
my_doc_email_destinataire_tmp = str(my_doc['email_destinataire']).replace(",", ";").split(";")
for mail in my_doc_email_destinataire_tmp:
my_doc_email_destinataire.append(str(mail).strip())
if( str(diction['email_destinataire']).strip() not in my_doc_email_destinataire ):
return False, " Impossible de signer le document. Email invalide "
encoded_signed_pdf_to_string = base64.b64encode(decrypted_message)
new_data = {}
new_data['signature_digitale'] = msg.digitalsignature
@ -798,12 +829,8 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
qry_key = {'valide': '1', 'locked': '0',
'_id': ObjectId(str(diction['e_doc_id'])),
'secret_key_signature': str(diction['secret_key_signature']),
'email_destinataire': str(diction['email_destinataire'])}
}
print({'valide': '1', 'locked': '0',
'_id': ObjectId(str(diction['e_doc_id'])),
'secret_key_signature': str(diction['secret_key_signature']),
'email_destinataire': str(diction['email_destinataire'])})
result = MYSY_GV.dbname['e_document_signe'].find_one_and_update(
qry_key,
@ -812,7 +839,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
return_document=ReturnDocument.AFTER
)
print(" result == ", result)
#print(" result == ", result)
if ("_id" not in result.keys()):
mycommon.myprint(
" Impossible de signer le document (2) ")
@ -834,7 +861,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
qry_key = {'valide': '1', 'locked': '0',
'_id': ObjectId(str(diction['e_doc_id'])),
'secret_key_signature': str(diction['secret_key_signature']),
'email_destinataire': str(diction['email_destinataire'])}
}
e_document_date_2 = MYSY_GV.dbname['e_document_signe'].find_one(qry_key)
@ -955,7 +982,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
qry_key = {'valide': '1', 'locked': '0',
'_id': ObjectId(str(diction['e_doc_id'])),
'secret_key_signature': str(diction['secret_key_signature']),
'email_destinataire': str(diction['email_destinataire'])}
}
new_data = {}

View File

@ -26,6 +26,8 @@ if (MYSY_ENV == "PROD"):
CLIENT_URL_BASE = 'https://www.mysy-training.com/'
MYSY_DEBUG_LEVEL = 0
# Domaine pour le catalogue public
MYSY_PUBLIC_CATALOG_DOMAIN = 'mysy-hosting.online'
elif (MYSY_ENV == "DEV"):
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_dev"
@ -34,6 +36,10 @@ elif (MYSY_ENV == "DEV"):
CLIENT_URL_BASE = 'http://localhost:3009/'
MYSY_DEBUG_LEVEL = 1
# Domaine pour le catalogue public
MYSY_PUBLIC_CATALOG_DOMAIN = 'localhost:3009'
elif (MYSY_ENV == "REC"):
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_rec"
client = MongoClient(CONNECTION_STRING)
@ -41,6 +47,9 @@ elif (MYSY_ENV == "REC"):
CLIENT_URL_BASE = 'https://dev.mysy-training.com/'
MYSY_DEBUG_LEVEL = 1
# Domaine pour le catalogue public
MYSY_PUBLIC_CATALOG_DOMAIN = 'devmysy-hosting.online'
elif (MYSY_ENV == "DEM"):
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_demo"
client = MongoClient(CONNECTION_STRING)
@ -48,6 +57,9 @@ elif (MYSY_ENV == "DEM"):
CLIENT_URL_BASE = 'https://demo.mysy-training.com/'
MYSY_DEBUG_LEVEL = 1
# Domaine pour le catalogue public
MYSY_PUBLIC_CATALOG_DOMAIN = 'devmysy-hosting.online'
YTUBES_CONNECTION_STRING = "mongodb://localhost:27017/"

File diff suppressed because one or more lines are too long

View File

@ -242,13 +242,17 @@ def Get_Partner_Catalog_Pub_Config(diction):
user['id'] = str(val_tmp)
val_tmp = val_tmp + 1
if( "logo" not in retval.keys() ):
user['logo'] = ""
"""
Recuperer les données (preview) du
config_partner_catalog_theme
"""
user['theme_preview'] = ""
if( "theme_id" in retval.keys() and retval['theme_id']):
config_partner_catalog_theme_data = MYSY_GV.dbname['config_partner_catalog_theme'].find_one({'_id':ObjectId(str(retval['theme_id'])),
'valide':'1',
'locked':'0',
@ -257,6 +261,8 @@ def Get_Partner_Catalog_Pub_Config(diction):
if( config_partner_catalog_theme_data and "theme_preview" in config_partner_catalog_theme_data.keys() ):
user['theme_preview'] = config_partner_catalog_theme_data['theme_preview']
else:
user['theme_id'] = ""
RetObject.append(mycommon.JSONEncoder().encode(user))

View File

@ -1966,6 +1966,9 @@ def get_class(diction):
if diction['token']:
my_token = diction['token']
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data({'token':str(my_token)})
if (local_status is not True):
return local_status, my_partner
client_connected_recid = ""
connection_type = ""
@ -2035,6 +2038,8 @@ def get_class(diction):
return False, " Impossible de récupérer le token du partenaire"
RetObject = []
filt_external_code = {}
internal_url = ""
@ -2313,6 +2318,47 @@ def get_class(diction):
if ("recyclage_periodicite" not in user.keys()):
user['recyclage_periodicite'] = ""
"""
15/09/2024 :
Si la formation a des unité d'enseignements rattaché,
ramener dans un tableau :
- _id
- code
- titre
- description
"""
tab_ue_detail_data = []
if( "list_unite_enseignement" in user.keys() ):
for tmp_ue in user["list_unite_enseignement"] :
if( "_id" in tmp_ue.keys() ):
local_ue_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id':ObjectId(str(tmp_ue['_id'])),
'partner_owner_recid':my_partner['recid'],
'valide':'1',
'locked':'0'})
local_code = ""
if( local_ue_data and "code" in local_ue_data.keys() ):
local_code = local_ue_data['code']
local_titre = ""
if (local_ue_data and "titre" in local_ue_data.keys()):
local_titre = local_ue_data['titre']
local_description = ""
if (local_ue_data and "description" in local_ue_data.keys()):
local_description = local_ue_data['description']
local_node = {}
local_node['_id'] = str(tmp_ue['_id'])
local_node['code'] = str(local_code)
local_node['titre'] = str(local_titre)
local_node['description'] = str(local_description)
tab_ue_detail_data.append(local_node)
user['tab_ue_detail_data'] = tab_ue_detail_data
RetObject.append(JSONEncoder().encode(user))