21/07/26 - 21h

Signed-off-by: Cherif <cbalde@mysy-training.com>
master_Elyos_FI
Cherif 2026-07-21 21:35:52 +02:00
parent 0a0e4e1f2d
commit b0b2e5f520
5 changed files with 2626 additions and 39 deletions

View File

@ -4,14 +4,12 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="16/07/2026 - 20h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="19/07/26 - 21h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.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$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wrapper.py" beforeDir="false" afterPath="$PROJECT_DIR$/wrapper.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$/ent_student_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/ent_student_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -455,7 +453,7 @@
<option name="project" value="LOCAL" />
<updated>1747251650255</updated>
</task>
<option name="localTasksCounter" value="609" />
<option name="localTasksCounter" value="610" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -497,7 +495,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="20/05/2026 - 12h30" />
<MESSAGE value="20/05/2026 - 20h30" />
<MESSAGE value="22/05/2026 - 20h" />
<MESSAGE value="23/05/2026 - 20h00" />
@ -522,6 +519,7 @@
<MESSAGE value="09/07/26 - 20h" />
<MESSAGE value="14/07/2026 - 20h" />
<MESSAGE value="16/07/2026 - 20h" />
<option name="LAST_COMMIT_MESSAGE" value="16/07/2026 - 20h" />
<MESSAGE value="19/07/26 - 21h" />
<option name="LAST_COMMIT_MESSAGE" value="19/07/26 - 21h" />
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -832,17 +832,16 @@ def get_user_account(diction):
"""
Si plusieurs personnes ont ce token, alors rejette la connexion, car pas normal.
Un token valide ne doit appartenir qu'a un et seul user
"""
cout_user_with_same_token = coll_name.count_documents({'token': str(token_value), 'locked': '0', 'active':'1'})
cout_user_with_same_token = MYSY_GV.dbname['user_account'].count_documents({'token': str(token_value), 'locked': '0', 'active':'1'})
if( cout_user_with_same_token > 1 ):
mycommon.myprint(str(inspect.stack()[0][3]) + " Violation des règles du token ")
return False, "L'email ou le token ne sont pas valides (2) "
RetObject = []
for retVal in coll_name.find({'token': str(token_value), 'locked': '0', 'active':'1'}):
for retVal in MYSY_GV.dbname['user_account'].find({'token': str(token_value), 'locked': '0', 'active':'1'}):
mycommon.myprint(retVal)
user = retVal
@ -875,7 +874,7 @@ def get_user_account(diction):
if ("birthday" not in user.keys() or str(user['birthday']) == ""):
user['date_naissance'] = "01/01/1900"
#print(" ### user = ", user)
print(" ### user = ", user)
RetObject.append(JSONEncoder().encode(user))
return True, RetObject

View File

@ -2199,6 +2199,9 @@ def Get_Ent_Student_update_user_account(diction):
mycommon.myprint(" MAJ de diction "+str(diction))
rh_partner_recid = ""
global_apprenant_id = ""
global_apprenant_partner_owner_recid = ""
global_apprenant_email = ""
@ -2250,11 +2253,14 @@ def Get_Ent_Student_update_user_account(diction):
'valide': '1',
'locked': '0'})
rh_partner_recid = ressource_humaine_data['partner_recid']
"""
22/05/2026 - On va aussi mettre à jour le dossier apprenant
"""
dictionnary_for_apprenant = {}
dictionnary_for_ressource_humaine = {}
coll_name = MYSY_GV.dbname['user_account']
@ -2269,31 +2275,39 @@ def Get_Ent_Student_update_user_account(diction):
if ("adr_street" in diction.keys()):
dictionnary['adr_street'] = str(diction['adr_street'])
dictionnary_for_apprenant['adresse'] = str(diction['adr_street'])
dictionnary_for_ressource_humaine['adr_adresse'] = str(diction['adr_street'])
if ("adr_city" in diction.keys()):
dictionnary['adr_city'] = str(diction['adr_city'])
dictionnary_for_apprenant['ville'] = str(diction['adr_city'])
dictionnary_for_ressource_humaine['adr_ville'] = str(diction['adr_city'])
if( "adr_zip" in diction.keys() ):
dictionnary['adr_zip'] = str(diction['adr_zip'])
dictionnary_for_apprenant['code_postal'] = str(diction['adr_zip'])
dictionnary_for_ressource_humaine['adr_code_postal'] = str(diction['adr_zip'])
if ("adr_country" in diction.keys()):
dictionnary['adr_country'] = str(diction['adr_country'])
dictionnary_for_apprenant['pays'] = str(diction['adr_country'])
dictionnary_for_ressource_humaine['adr_pays'] = str(diction['adr_country'])
if ("mob_phone" in diction.keys()):
dictionnary['mob_phone'] = str(diction['mob_phone'])
dictionnary_for_apprenant['telephone'] = str(diction['mob_phone'])
dictionnary_for_ressource_humaine['telephone_mobile'] = str(diction['mob_phone'])
if ("link_facebook" in diction.keys()):
dictionnary['link_facebook'] = str(diction['link_facebook'])
dictionnary_for_apprenant['link_facebook'] = str(diction['link_facebook'])
dictionnary_for_ressource_humaine['facebook'] = str(diction['link_facebook'])
if ("link_twitter" in diction.keys()):
dictionnary['link_twitter'] = str(diction['link_twitter'])
dictionnary_for_apprenant['link_twitter'] = str(diction['link_twitter'])
dictionnary_for_ressource_humaine['twitter'] = str(diction['link_twitter'])
if ("token" in diction.keys()):
if (str(diction['token'])):
@ -2306,18 +2320,22 @@ def Get_Ent_Student_update_user_account(diction):
if ("prenom" in diction.keys()):
dictionnary['prenom'] = str(diction['prenom'])
dictionnary_for_apprenant['prenom'] = str(diction['prenom'])
dictionnary_for_ressource_humaine['prenom'] = str(diction['prenom'])
if ("nom" in diction.keys()):
dictionnary['nom'] = str(diction['nom'])
dictionnary_for_apprenant['nom'] = str(diction['nom'])
dictionnary_for_ressource_humaine['nom'] = str(diction['nom'])
if ("date_naissance" in diction.keys()):
dictionnary['birthday'] = str(diction['date_naissance'])
dictionnary_for_apprenant['date_naissance'] = str(diction['date_naissance'])
dictionnary_for_ressource_humaine['date_naissance'] = str(diction['date_naissance'])
if ("link_linkedin" in diction.keys()):
dictionnary['link_linkedin'] = str(diction['link_linkedin'])
dictionnary_for_apprenant['link_linkedin'] = str(diction['link_linkedin'])
dictionnary_for_ressource_humaine['linkedin'] = str(diction['link_linkedin'])
if ("num_cvec" in diction.keys()):
dictionnary_for_apprenant['num_cvec'] = str(diction['num_cvec'])
@ -2325,6 +2343,7 @@ def Get_Ent_Student_update_user_account(diction):
if ("civilite" in diction.keys()):
dictionnary['civilite'] = str(diction['civilite'])
dictionnary_for_apprenant['civilite'] = str(diction['civilite'])
dictionnary_for_ressource_humaine['civilite'] = str(diction['civilite'])
if ("num_cvec" in diction.keys()):
dictionnary_for_apprenant['num_cvec'] = str(diction['num_cvec'])
@ -2332,6 +2351,7 @@ def Get_Ent_Student_update_user_account(diction):
if ("nom_fille" in diction.keys()):
dictionnary['nom_fille'] = str(diction['nom_fille'])
dictionnary_for_apprenant['nom_fille'] = str(diction['nom_fille'])
dictionnary_for_ressource_humaine['nom_fille'] = str(diction['nom_fille'])
@ -2358,7 +2378,9 @@ def Get_Ent_Student_update_user_account(diction):
if( diction['type_connexion'] == "tuteur"):
ret_val = coll_name.find_one_and_update({'token':str(diction['token']),
ret_val = MYSY_GV.dbname['user_account'].find_one_and_update({'token':str(diction['token']),
'active':'1', 'locked':'0',
'rh_id': diction['rh_id'],
},
@ -2368,6 +2390,21 @@ def Get_Ent_Student_update_user_account(diction):
if (ret_val and ret_val['_id']):
mycommon.myprint(str(inspect.stack()[0][3]) + " -La modif a bien ete faite =" + str(ret_val['_id']))
"""
20/07/2026 - Mise à jour du tuteur RH
"""
updated_ressource_humaine = MYSY_GV.dbname['ressource_humaine'].find_one_and_update({'_id': ObjectId(str(diction['rh_id'])),
'valide': '1',
'locked': '0',
'partner_recid':str(rh_partner_recid)},
{"$set": dictionnary_for_ressource_humaine},
return_document=ReturnDocument.AFTER
)
print(" updated_ressource_humaine = ", updated_ressource_humaine)
return True, " Le compte utilisateur a ete mis à jour"
else:
mycommon.myprint(str(inspect.stack()[0][3]) + " - Aucune modif n'a été faite")
@ -3137,7 +3174,7 @@ def Get_Ent_Student_Apprenant_IMG_Profil(diction):
"""
Verification de la liste des champs obligatoires
"""
field_list_obligatoire = ['token', 'apprenant_id']
field_list_obligatoire = ['token', 'apprenant_id', 'type_connexion']
for val in field_list_obligatoire:
if val not in diction:
mycommon.myprint(
@ -3149,35 +3186,49 @@ def Get_Ent_Student_Apprenant_IMG_Profil(diction):
if (local_status is not True):
return local_status, my_partner
"""
Verifier la validité de l'apprenant
"""
is_apprenant_valide_count = MYSY_GV.dbname['apprenant'].count_documents(
{'_id': ObjectId(str(diction['apprenant_id'])),
'valide': '1',
'locked': '0'})
if (is_apprenant_valide_count != 1):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " L'identifiant de l'apprenant est invalide ")
return False, " L'identifiant de l'apprenant est invalide ",
if( "type_connexion" in diction.keys() and diction['type_connexion'] == "tuteur"):
qery_images = {'locked': '0', 'valide': '1', 'related_collection': 'ressource_humaine',
'related_collection_recid': str(diction['apprenant_id'])}
RetObject = []
partner_images = {}
# Recuperation des image 'logo' et 'cachet' si le partenaire en a
for retVal in MYSY_GV.dbname['mysy_images'].find(qery_images):
if ('type_img' in retVal.keys()):
if (retVal['type_img'] == "user"):
partner_images['logo_img'] = retVal['img'].decode()
partner_images['logo_img_recid'] = retVal['recid']
else:
"""
Verifier la validité de l'apprenant
"""
is_apprenant_valide_count = MYSY_GV.dbname['apprenant'].count_documents(
{'_id': ObjectId(str(diction['apprenant_id'])),
'valide': '1',
'locked': '0'})
if (is_apprenant_valide_count != 1):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " L'identifiant de l'apprenant est invalide ")
return False, " L'identifiant de l'apprenant est invalide ",
qery_images = {'locked': '0', 'valide': '1', 'related_collection': 'apprenant',
'related_collection_recid': str(diction['apprenant_id'])}
qery_images = {'locked': '0', 'valide': '1', 'related_collection': 'apprenant',
'related_collection_recid': str(diction['apprenant_id'])}
# print(" ### qery_images = ", qery_images)
# print(" ### qery_images = ", qery_images)
RetObject = []
partner_images = {}
# Recuperation des image 'logo' et 'cachet' si le partenaire en a
for retVal in MYSY_GV.dbname['mysy_images'].find(qery_images):
if ('type_img' in retVal.keys()):
if (retVal['type_img'] == "user"):
partner_images['logo_img'] = retVal['img'].decode()
partner_images['logo_img_recid'] = retVal['recid']
RetObject = []
partner_images = {}
# Recuperation des image 'logo' et 'cachet' si le partenaire en a
for retVal in MYSY_GV.dbname['mysy_images'].find(qery_images):
if ('type_img' in retVal.keys()):
if (retVal['type_img'] == "user"):
partner_images['logo_img'] = retVal['img'].decode()
partner_images['logo_img_recid'] = retVal['recid']
RetObject.append(mycommon.JSONEncoder().encode(partner_images))

View File

@ -1749,7 +1749,7 @@ def get_partner_account(diction):
formation_initiale = str(admin_partnair_account['formation_initiale'])
user['formation_initiale'] = formation_initiale
"""
document_super_admin = "0"
if (admin_partnair_account and "document_super_admin" in admin_partnair_account.keys()):
document_super_admin = str(admin_partnair_account['document_super_admin'])
@ -1760,7 +1760,9 @@ def get_partner_account(diction):
plateforme_super_admin = str(admin_partnair_account['plateforme_super_admin'])
user['plateforme_super_admin'] = plateforme_super_admin
"""
#print(" ### useruser connexion = ", user)
RetObject.append(JSONEncoder().encode(user))