04/01/2024 - 18:00
parent
8404e94d76
commit
a495cb6a6a
|
@ -1,16 +1,11 @@
|
|||
<?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="01/01/2024- 18h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="03/01/2024 - 17h30">
|
||||
<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$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -80,13 +75,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00137" summary="23/10/2023 - 16h">
|
||||
<created>1698067991140</created>
|
||||
<option name="number" value="00137" />
|
||||
<option name="presentableId" value="LOCAL-00137" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1698067991141</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00138" summary="30/10/23 - 16h">
|
||||
<created>1698679792176</created>
|
||||
<option name="number" value="00138" />
|
||||
|
@ -423,7 +411,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1704127826605</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="186" />
|
||||
<task id="LOCAL-00186" summary="03/01/2024 - 17h30">
|
||||
<created>1704298822115</created>
|
||||
<option name="number" value="00186" />
|
||||
<option name="presentableId" value="LOCAL-00186" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1704298822115</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="187" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -438,7 +433,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="01/12/2023 - 23h" />
|
||||
<MESSAGE value="04/12/2023 - 21h" />
|
||||
<MESSAGE value="05/12/2023 - 21h" />
|
||||
<MESSAGE value="06/12/2023 - 21h" />
|
||||
|
@ -463,6 +457,7 @@
|
|||
<MESSAGE value="29/12/2023- 12h" />
|
||||
<MESSAGE value="31/12/2023- 18h" />
|
||||
<MESSAGE value="01/01/2024- 18h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="01/01/2024- 18h" />
|
||||
<MESSAGE value="03/01/2024 - 17h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="03/01/2024 - 17h30" />
|
||||
</component>
|
||||
</project>
|
5257
Log/log_file.log
5257
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -50,7 +50,7 @@ def Add_Update_SessionFormation(diction):
|
|||
# field_list.
|
||||
'''
|
||||
field_list = ['token', 'date_debut', 'date_fin', 'nb_participant', 'adresse',
|
||||
'code_postal', 'ville', 'formateur', 'code_session',
|
||||
'code_postal', 'ville', 'code_session',
|
||||
'class_internal_url', 'session_status', 'date_debut_inscription', 'date_fin_inscription',
|
||||
'attestation_certif', "distantiel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
|
||||
'session_ondemande', 'source', 'session_id', 'session_etape', 'pays', 'formateur_id',
|
||||
|
@ -148,13 +148,20 @@ def Add_Update_SessionFormation(diction):
|
|||
|
||||
if ("distantiel" in diction.keys()):
|
||||
mydata['distantiel'] = str(mycommon.tryInt(str(diction['distantiel'])))
|
||||
|
||||
else:
|
||||
mydata['distantiel'] = "0"
|
||||
|
||||
if ("presentiel" in diction.keys()):
|
||||
mydata['presentiel'] = str(mycommon.tryInt(str(diction['presentiel'])))
|
||||
else:
|
||||
mydata['presentiel'] = "0"
|
||||
|
||||
|
||||
if ("session_ondemande" in diction.keys()):
|
||||
mydata['session_ondemande'] = str(mycommon.tryInt(str(diction['session_ondemande'])))
|
||||
else:
|
||||
mydata['session_ondemande'] = "0"
|
||||
|
||||
|
||||
|
||||
if ("nb_participant" in diction.keys()):
|
||||
|
@ -162,6 +169,8 @@ def Add_Update_SessionFormation(diction):
|
|||
if( nb_particants == "0" ):
|
||||
nb_particants = "1"
|
||||
mydata['nb_participant'] = str(mycommon.tryInt(str(diction['nb_participant'])))
|
||||
else:
|
||||
mydata['nb_participant'] = "1"
|
||||
|
||||
if ("prix_session" in diction.keys()):
|
||||
mydata['prix_session'] = diction['prix_session']
|
||||
|
@ -169,18 +178,20 @@ def Add_Update_SessionFormation(diction):
|
|||
|
||||
if ("titre" in diction.keys()):
|
||||
mydata['titre'] = diction['titre']
|
||||
else:
|
||||
mydata['titre'] = ""
|
||||
|
||||
if ("location_type" in diction.keys()):
|
||||
mydata['location_type'] = str(diction['location_type']).lower()
|
||||
if (str(diction['location_type']).lower() not in MYSY_GV.TRAINING_LOCATION_TYPE):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'is_bpf' est incorrecte.")
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'location_type' est incorrecte.")
|
||||
return False, "Le champ 'location_type' est incorrect."
|
||||
|
||||
|
||||
if ("is_bpf" in diction.keys()):
|
||||
if( str(diction['is_bpf']) not in ['0', '1']):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'bpf' est incorrect.")
|
||||
return False, "Le champ 'bpf' est incorrect."
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' ")
|
||||
return False, "Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' "
|
||||
|
||||
mydata['is_bpf'] = diction['is_bpf']
|
||||
|
||||
|
@ -234,24 +245,35 @@ def Add_Update_SessionFormation(diction):
|
|||
else:
|
||||
mydata['pays'] = ""
|
||||
|
||||
"""
|
||||
if ("attestation_certif" in diction.keys()):
|
||||
mydata['attestation_certif'] = diction['attestation_certif']
|
||||
|
||||
"""
|
||||
|
||||
if ("session_status" in diction.keys()):
|
||||
mydata['session_status'] = str(mycommon.tryInt(str(diction['session_status'])))
|
||||
else:
|
||||
mydata['session_status'] = ""
|
||||
|
||||
if ("date_debut_inscription" in diction.keys()):
|
||||
mydata['date_debut_inscription'] = str(diction['date_debut_inscription'])[0:10]
|
||||
else:
|
||||
mydata['date_debut_inscription'] = ""
|
||||
|
||||
if ("date_fin_inscription" in diction.keys()):
|
||||
mydata['date_fin_inscription'] = str(diction['date_fin_inscription'])[0:10]
|
||||
else:
|
||||
mydata['date_fin_inscription'] = ""
|
||||
|
||||
""""
|
||||
if ("formateur" in diction.keys()):
|
||||
mydata['formateur'] = diction['formateur']
|
||||
"""
|
||||
|
||||
if ("contenu_ftion" in diction.keys()):
|
||||
mydata['contenu_ftion'] = diction['contenu_ftion']
|
||||
else:
|
||||
mydata['contenu_ftion'] = ""
|
||||
|
||||
"""
|
||||
Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenaire
|
||||
|
@ -334,12 +356,11 @@ def Add_Update_SessionFormation(diction):
|
|||
str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Formation : "+str(code_session)+" : La date date_debut_inscription " + str(
|
||||
diction['date_debut_inscription']) +
|
||||
" est postérieure à la date de date_fin_inscription " + str(diction['date_fin_inscription']) )
|
||||
3]) + " Formation : "+str(code_session)+" : La date de début d'inscription " + str(diction['date_debut_inscription'])[0:10] + \
|
||||
" est postérieure à la date de fin d'inscription " + str(diction['date_fin_inscription'])[0:10] + " " )
|
||||
|
||||
return False, " Formation : "+str(code_session)+" : La date_debut_inscription " + str(diction['date_debut_inscription']) + \
|
||||
" est postérieure à la date_fin_inscription " + str(diction['date_fin_inscription']) + " "
|
||||
return False, " Formation : "+str(code_session)+" : La date de début d'inscription " + str(diction['date_debut_inscription'])[0:10] + \
|
||||
" est postérieure à la date de fin d'inscription " + str(diction['date_fin_inscription'])[0:10] + " "
|
||||
|
||||
|
||||
|
||||
|
@ -404,7 +425,7 @@ def Add_Update_SessionFormation(diction):
|
|||
existing_session_code = local_retval1['code_session']
|
||||
existing_class_internal_url = local_retval1['class_internal_url']
|
||||
current_step = local_retval1['session_etape']
|
||||
print(" ### current_step = ", current_step)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -434,7 +455,7 @@ def Add_Update_SessionFormation(diction):
|
|||
return False, "Impossible d'ajouter/mettre à jour la session '" + str(diction['code_session']) + "' "
|
||||
|
||||
new_step = ret_val['session_etape']
|
||||
print(" ### new_step = ", new_step)
|
||||
|
||||
|
||||
"""
|
||||
# Ajout de l'evenement dans l'historique
|
||||
|
@ -571,7 +592,7 @@ def GetSessionFormation(diction):
|
|||
'from': 'myclass',
|
||||
'localField': 'class_internal_url',
|
||||
'foreignField': 'internal_url',
|
||||
'pipeline': [{'$project': {'title': 1, 'lms_class_code':1, 'external_code':1}}],
|
||||
'pipeline': [{'$project': {'title': 1, 'lms_class_code':1, 'external_code':1, 'published':1}}],
|
||||
'as': 'myclass'
|
||||
}
|
||||
}
|
||||
|
@ -590,6 +611,8 @@ def GetSessionFormation(diction):
|
|||
title = ""
|
||||
lms_class_code = ""
|
||||
class_external_code = ""
|
||||
class_ispublished = "0"
|
||||
|
||||
if ('myclass' in retval.keys() and len(retval['myclass']) > 0):
|
||||
|
||||
if( "title" in retval['myclass'][0].keys()):
|
||||
|
@ -602,9 +625,14 @@ def GetSessionFormation(diction):
|
|||
if ("external_code" in retval['myclass'][0].keys()):
|
||||
class_external_code = retval['myclass'][0]['external_code']
|
||||
|
||||
|
||||
if ("published" in retval['myclass'][0].keys()):
|
||||
class_ispublished = retval['myclass'][0]['published']
|
||||
|
||||
user['title'] = title
|
||||
user['lms_class_code'] = lms_class_code
|
||||
user['class_external_code'] = class_external_code
|
||||
user['class_ispublished'] = class_ispublished
|
||||
|
||||
formateur_nom_prenom = ""
|
||||
# Si il y a un code formateur_id, alors on va recuperer les nom et prenom du formation
|
||||
|
@ -1907,11 +1935,6 @@ def Add_Update_SessionFormation_mass(file=None, Folder=None, diction=None):
|
|||
|
||||
#mydata['attestation_certif'] = str(df['attestation'].values[n]).strip()
|
||||
|
||||
local_formateur = ""
|
||||
if ("formateur" in df.keys()):
|
||||
if (str(df['formateur'].values[n])):
|
||||
local_formateur = str(df['formateur'].values[n]).strip()
|
||||
mydata['formateur'] = local_formateur
|
||||
|
||||
session_status = ""
|
||||
if ("session_status" in df.keys()):
|
||||
|
@ -2102,7 +2125,7 @@ def Controle_Add_Update_SessionFormation_mass(saved_file=None, Folder=None, dict
|
|||
# Verification que les noms des colonne sont bien corrects"
|
||||
'''
|
||||
field_list = ['date_debut', 'date_fin', 'nb_participant', 'adresse', 'code_postal', 'ville', 'pays',
|
||||
'session_status', 'date_debut_inscription', 'date_fin_inscription', 'attestation', 'formateur',
|
||||
'session_status', 'date_debut_inscription', 'date_fin_inscription', 'attestation',
|
||||
'code_session', "distanciel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
|
||||
'session_ondemande', 'session_etape', 'formation_code_externe','formateur_email', 'titre', 'location_type', 'is_bpf']
|
||||
|
||||
|
@ -2270,10 +2293,10 @@ def Controle_Add_Update_SessionFormation_mass(saved_file=None, Folder=None, dict
|
|||
|
||||
if ("is_bpf" in df.keys()):
|
||||
if (str(df['is_bpf'].values[n]).strip() not in ['0', '1']):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'bpf' est incorrect.")
|
||||
return False, "Le champ 'bpf' est incorrect."
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' ")
|
||||
return False, "Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' "
|
||||
|
||||
mydata['is_bpf'] = diction['is_bpf']
|
||||
mydata['is_bpf'] = str(df['is_bpf'].values[n]).strip()
|
||||
|
||||
|
||||
## Verification de la cohérence des dates. Date_du doit <= Date_au
|
||||
|
@ -2431,11 +2454,6 @@ def Controle_Add_Update_SessionFormation_mass(saved_file=None, Folder=None, dict
|
|||
|
||||
# mydata['attestation_certif'] = str(df['attestation'].values[n]).strip()
|
||||
|
||||
local_formateur = ""
|
||||
if ("formateur" in df.keys()):
|
||||
if (str(df['formateur'].values[n])):
|
||||
local_formateur = str(df['formateur'].values[n]).strip()
|
||||
mydata['formateur'] = local_formateur
|
||||
|
||||
session_status = ""
|
||||
if ("session_status" in df.keys()):
|
||||
|
@ -2612,10 +2630,10 @@ def Add_Update_SessionFormation_mass_for_many_class(file=None, Folder=None, dict
|
|||
'''
|
||||
# Verification que les noms des colonne sont bien corrects"
|
||||
'''
|
||||
field_list = ['date_debut', 'date_fin', 'nb_participant', 'adresse', 'code_postal', 'ville',
|
||||
'session_status', 'date_debut_inscription', 'date_fin_inscription', 'attestation', 'formateur',
|
||||
field_list = ['date_debut', 'date_fin', 'nb_participant', 'adresse', 'code_postal', 'ville', 'pays',
|
||||
'session_status', 'date_debut_inscription', 'date_fin_inscription', 'attestation',
|
||||
'code_session', "distanciel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
|
||||
'session_ondemande', 'session_etape', 'formation_code_externe']
|
||||
'session_ondemande', 'session_etape', 'formation_code_externe', 'formateur_email', 'titre', 'location_type', 'is_bpf']
|
||||
|
||||
# Controle du nombre de lignes dans le fichier.
|
||||
total_rows = len(df)
|
||||
|
@ -2740,10 +2758,10 @@ def Add_Update_SessionFormation_mass_for_many_class(file=None, Folder=None, dict
|
|||
|
||||
if ("is_bpf" in df.keys()):
|
||||
if (str(df['is_bpf'].values[n]).strip() not in ['0', '1']):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'bpf' est incorrect.")
|
||||
return False, "Le champ 'bpf' est incorrect."
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' ")
|
||||
return False, "Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' "
|
||||
|
||||
mydata['is_bpf'] = diction['is_bpf']
|
||||
mydata['is_bpf'] = str(df['is_bpf'].values[n]).strip()
|
||||
|
||||
|
||||
|
||||
|
@ -2843,6 +2861,8 @@ def Add_Update_SessionFormation_mass_for_many_class(file=None, Folder=None, dict
|
|||
mydata['adresse'] = local_adresse
|
||||
|
||||
|
||||
|
||||
|
||||
session_ondemande = ""
|
||||
if ("session_ondemande" in df.keys()):
|
||||
if (str(df['session_ondemande'].values[n])):
|
||||
|
@ -2909,6 +2929,12 @@ def Add_Update_SessionFormation_mass_for_many_class(file=None, Folder=None, dict
|
|||
local_ville = str(df['ville'].values[n]).strip()
|
||||
mydata['ville'] = local_ville
|
||||
|
||||
pays = ""
|
||||
if ("pays" in df.keys()):
|
||||
if (str(df['pays'].values[n])):
|
||||
local_adresse = str(df['pays'].values[n]).strip()
|
||||
mydata['pays'] = pays
|
||||
|
||||
contenu_ftion = ""
|
||||
if ("contenu_ftion" in df.keys()):
|
||||
if (str(df['contenu_ftion'].values[n])):
|
||||
|
@ -2916,20 +2942,15 @@ def Add_Update_SessionFormation_mass_for_many_class(file=None, Folder=None, dict
|
|||
mydata['contenu_ftion'] = contenu_ftion
|
||||
|
||||
# mydata['ville'] = str(df['ville'].values[n]).strip()
|
||||
|
||||
"""
|
||||
local_attestation_certif = ""
|
||||
if ("attestation" in df.keys()):
|
||||
if (str(df['attestation'].values[n])):
|
||||
local_attestation_certif = str(df['attestation'].values[n]).strip()
|
||||
mydata['attestation_certif'] = local_attestation_certif
|
||||
|
||||
|
||||
# mydata['attestation_certif'] = str(df['attestation'].values[n]).strip()
|
||||
|
||||
local_formateur = ""
|
||||
if ("formateur" in df.keys()):
|
||||
if (str(df['formateur'].values[n])):
|
||||
local_formateur = str(df['formateur'].values[n]).strip()
|
||||
mydata['formateur'] = local_formateur
|
||||
"""
|
||||
|
||||
session_status = ""
|
||||
if ("session_status" in df.keys()):
|
||||
|
@ -3111,9 +3132,9 @@ def Controle_Add_Update_SessionFormation_mass_for_many_class(saved_file=None, Fo
|
|||
# Verification que les noms des colonne sont bien corrects"
|
||||
'''
|
||||
field_list = ['date_debut', 'date_fin', 'nb_participant', 'adresse', 'code_postal', 'ville', 'pays',
|
||||
'session_status', 'date_debut_inscription', 'date_fin_inscription', 'attestation', 'formateur',
|
||||
'session_status', 'date_debut_inscription', 'date_fin_inscription', 'attestation',
|
||||
'code_session', "distanciel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
|
||||
'session_ondemande', 'session_etape', 'formation_code_externe']
|
||||
'session_ondemande', 'session_etape', 'formation_code_externe', 'formateur_email', 'titre', 'location_type', 'is_bpf']
|
||||
|
||||
# Controle du nombre de lignes dans le fichier.
|
||||
total_rows = len(df)
|
||||
|
@ -3235,6 +3256,64 @@ def Controle_Add_Update_SessionFormation_mass_for_many_class(saved_file=None, Fo
|
|||
" est postérieure à la date de fin " + str(mydata['date_fin'])[0:10] + " pour la ligne " + str(
|
||||
n + 2) + " "
|
||||
|
||||
# Verifier que l'adresse email du formateur est valide
|
||||
formateur_email = ""
|
||||
formateur_id = ""
|
||||
if ("formateur_email" in df.keys()):
|
||||
if (str(df['formateur_email'].values[n])):
|
||||
|
||||
formateur_email = str(df['formateur_email'].values[n]).strip()
|
||||
if (mycommon.isEmailValide(formateur_email) is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " - L'email du formateur '" + str(
|
||||
formateur_email) + "' pour la formation à la ligne " + str(
|
||||
n + 2) + " n'est pas valide.")
|
||||
return False, " L'email du formateur '" + str(
|
||||
formateur_email) + "' pour la formation à la ligne " + str(
|
||||
n + 2) + " n'est pas valide."
|
||||
|
||||
is_formateur_email_ok = MYSY_GV.dbname['ressource_humaine'].count_documents(
|
||||
{'email': formateur_email,
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_recid': str(
|
||||
partner_recid)})
|
||||
if (is_formateur_email_ok <= 0):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " - L'email du formateur '" + str(
|
||||
formateur_email) + "' pour la formation à la ligne " + str(
|
||||
n + 2) + " n'est pas valide (2).")
|
||||
return False, " L'email du formateur '" + str(
|
||||
formateur_email) + "' pour la formation à la ligne " + str(
|
||||
n + 2) + " n'est pas valide (2)."
|
||||
|
||||
formateur_data = MYSY_GV.dbname['ressource_humaine'].find_one({'email': formateur_email,
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_recid': str(
|
||||
partner_recid)})
|
||||
|
||||
formateur_id = str(formateur_data['_id'])
|
||||
|
||||
mydata['formateur_id'] = formateur_id
|
||||
|
||||
if ("titre" in df.keys()):
|
||||
mydata['titre'] = str(df['titre'].values[n]).strip()
|
||||
|
||||
if ("location_type" in df.keys()):
|
||||
mydata['location_type'] = str(df['location_type'].values[n]).strip().lower()
|
||||
if (str(df['location_type'].values[n]).strip().lower() not in MYSY_GV.TRAINING_LOCATION_TYPE):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le champ 'location_type' est incorrecte. Les valeurs acceptés sont : "+str(MYSY_GV.TRAINING_LOCATION_TYPE))
|
||||
return False, "Le champ 'location_type' est incorrect. . Les valeurs acceptés sont : "+str(MYSY_GV.TRAINING_LOCATION_TYPE)+ " "
|
||||
|
||||
if ("is_bpf" in df.keys()):
|
||||
if (str(df['is_bpf'].values[n]).strip() not in ['0', '1']):
|
||||
mycommon.myprint(str(inspect.stack()[0][
|
||||
3]) + " - Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' ")
|
||||
return False, "Le champ 'bpf' est incorrect. Les valeurs acceptées sont : '1' ou '0' "
|
||||
|
||||
mydata['is_bpf'] = str(df['is_bpf'].values[n]).strip()
|
||||
|
||||
local_nb_participants = "1"
|
||||
if ("nb_participant" in df.keys()):
|
||||
if (str(df['nb_participant'].values[n])):
|
||||
|
@ -3376,11 +3455,6 @@ def Controle_Add_Update_SessionFormation_mass_for_many_class(saved_file=None, Fo
|
|||
|
||||
# mydata['attestation_certif'] = str(df['attestation'].values[n]).strip()
|
||||
|
||||
local_formateur = ""
|
||||
if ("formateur" in df.keys()):
|
||||
if (str(df['formateur'].values[n])):
|
||||
local_formateur = str(df['formateur'].values[n]).strip()
|
||||
mydata['formateur'] = local_formateur
|
||||
|
||||
session_status = ""
|
||||
if ("session_status" in df.keys()):
|
||||
|
@ -3423,6 +3497,7 @@ def Controle_Add_Update_SessionFormation_mass_for_many_class(saved_file=None, Fo
|
|||
n + 2) + ". La date_debut_inscription n'est pas au format jj/mm/aaaa "
|
||||
|
||||
mydata['date_fin_inscription'] = str(df['date_fin_inscription'].values[n]).strip().split(" ")[0]
|
||||
|
||||
local_status = mycommon.CheckisDate(mydata['date_fin_inscription'])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
|
|
|
@ -2143,9 +2143,9 @@ def Add_Ressource_Humaine_mass(file=None, Folder=None, diction=None):
|
|||
if( rh_profil_count<= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ profil " + str(
|
||||
df['profil'].values[n]) + " est invalide.")
|
||||
df['profil'].values[n]) + " est invalide. Rapprochez de votre administrateur pour créer ce profil d'employé")
|
||||
return False, " Le champ profil -" + str(
|
||||
df['profil'].values[n]) + "- est invalide."
|
||||
df['profil'].values[n]) + "- est invalide. Rapprochez de votre administrateur pour créer ce profil d'employé"
|
||||
|
||||
|
||||
mydata['ismanager'] = str(df['ismanager'].values[n])
|
||||
|
@ -2462,14 +2462,14 @@ def Controle_Add_Ressource_Humaine_mass(saved_file=None, Folder=None, diction=No
|
|||
if( superieur_hierarchie_data_count <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Aucun manager avec l'adresse email " + str(
|
||||
df['superieur_hierarchie_email'].values[n]) + " ")
|
||||
return False, " Aucun manager avec l'adresse email -" + str(df['superieur_hierarchie_email'].values[n]) + ""
|
||||
df['superieur_hierarchie_email'].values[n]) + ". Vous devez saisir l'adresse email exacte du supérieur hiérarchique ")
|
||||
return False, " Aucun manager avec l'adresse email -" + str(df['superieur_hierarchie_email'].values[n]) + ". Vous devez saisir l'adresse email exacte du supérieur hiérarchique "
|
||||
|
||||
if (superieur_hierarchie_data_count > 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Il a plusieurs managers avec l'adresse email " + str(
|
||||
str(inspect.stack()[0][3]) + " Il y a plusieurs managers avec l'adresse email " + str(
|
||||
df['superieur_hierarchie_email'].values[n]) + " ")
|
||||
return False, " Il a plusieurs managers avec l'adresse email -" + str(
|
||||
return False, " Il y a plusieurs managers avec l'adresse email -" + str(
|
||||
df['superieur_hierarchie_email'].values[n]) + ""
|
||||
|
||||
superieur_hierarchie_data = MYSY_GV.dbname['ressource_humaine'].find_one(
|
||||
|
|
Loading…
Reference in New Issue