19/08/23 - 15h30
parent
d2e732385e
commit
e9d1b5dab9
|
@ -1,10 +1,13 @@
|
|||
<?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="17/08/23 - 17h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="18/08/23 - 17h30">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/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" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -68,13 +71,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00024" summary="21/05/23 - 22h">
|
||||
<created>1684699348108</created>
|
||||
<option name="number" value="00024" />
|
||||
<option name="presentableId" value="LOCAL-00024" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1684699348108</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00025" summary="22/05/23 - 23h">
|
||||
<created>1684787274305</created>
|
||||
<option name="number" value="00025" />
|
||||
|
@ -411,7 +407,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1692284601884</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="73" />
|
||||
<task id="LOCAL-00073" summary="18/08/23 - 17h30">
|
||||
<created>1692372578246</created>
|
||||
<option name="number" value="00073" />
|
||||
<option name="presentableId" value="LOCAL-00073" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1692372578247</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="74" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -426,7 +429,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="22/07/2023 - 17h" />
|
||||
<MESSAGE value="23/07/2023 - 21h" />
|
||||
<MESSAGE value="24/07/23 - 17h" />
|
||||
<MESSAGE value="25/07/23 - 21h" />
|
||||
|
@ -451,6 +453,7 @@
|
|||
<MESSAGE value="15/08/23 - 20h" />
|
||||
<MESSAGE value="16/08/23 - 22h" />
|
||||
<MESSAGE value="17/08/23 - 17h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="17/08/23 - 17h" />
|
||||
<MESSAGE value="18/08/23 - 17h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="18/08/23 - 17h30" />
|
||||
</component>
|
||||
</project>
|
|
@ -49,7 +49,8 @@ def AddStagiairetoClass(diction):
|
|||
'''
|
||||
field_list = ['nom', 'prenom', 'email', 'telephone', 'modefinancement', 'opco',
|
||||
'class_internal_url', 'session_id', 'employeur', 'status', 'price',
|
||||
'inscription_validation_date', 'token']
|
||||
'inscription_validation_date', 'token', 'client_rattachement_id',
|
||||
'adresse', 'code_postal', 'ville', 'pays']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
|
@ -111,25 +112,12 @@ def AddStagiairetoClass(diction):
|
|||
mydata['date_du'] = tmp_val['date_debut']
|
||||
mydata['date_au'] = tmp_val['date_fin']
|
||||
|
||||
if ("ville" in tmp_val.keys()):
|
||||
if tmp_val['ville']:
|
||||
mydata['ville'] = tmp_val['ville']
|
||||
|
||||
if ("code_postal" in tmp_val.keys()):
|
||||
if tmp_val['code_postal']:
|
||||
mydata['code_postal'] = tmp_val['code_postal']
|
||||
|
||||
if ("adresse" in tmp_val.keys()):
|
||||
if tmp_val['adresse']:
|
||||
mydata['adresse'] = tmp_val['adresse']
|
||||
|
||||
if ("prix_session" in tmp_val.keys()):
|
||||
if tmp_val['prix_session']:
|
||||
new_price = tmp_val['prix_session']
|
||||
mydata['price'] = tmp_val['prix_session']
|
||||
|
||||
|
||||
print(" #### mydata = "+str(mydata))
|
||||
|
||||
if ("nom" in diction.keys()):
|
||||
if diction['nom']:
|
||||
|
@ -147,6 +135,27 @@ def AddStagiairetoClass(diction):
|
|||
if diction['telephone']:
|
||||
mydata['telephone'] = str(diction['telephone']).strip()
|
||||
|
||||
if ("client_rattachement_id" in diction.keys()):
|
||||
if diction['client_rattachement_id']:
|
||||
mydata['client_rattachement_id'] = diction['client_rattachement_id']
|
||||
|
||||
if ("pays" in diction.keys()):
|
||||
if diction['pays']:
|
||||
mydata['pays'] = diction['ville']
|
||||
|
||||
if ("ville" in diction.keys()):
|
||||
if diction['ville']:
|
||||
mydata['ville'] = diction['ville']
|
||||
|
||||
if ("code_postal" in diction.keys()):
|
||||
if diction['code_postal']:
|
||||
mydata['code_postal'] = diction['code_postal']
|
||||
|
||||
if ("adresse" in diction.keys()):
|
||||
if diction['adresse']:
|
||||
mydata['adresse'] = diction['adresse']
|
||||
|
||||
|
||||
if ("inscription_validation_date" in diction.keys()):
|
||||
if diction['inscription_validation_date']:
|
||||
mydata['inscription_validation_date'] = str(diction['inscription_validation_date']).strip()
|
||||
|
@ -203,7 +212,7 @@ def AddStagiairetoClass(diction):
|
|||
mydata['price'] = '0'
|
||||
|
||||
|
||||
|
||||
print(" #### mydata = " + str(mydata))
|
||||
|
||||
coll_inscription = MYSY_GV.dbname['inscription']
|
||||
|
||||
|
@ -278,7 +287,7 @@ def UpdateStagiairetoClass(diction):
|
|||
return_message = ""
|
||||
field_list = ['token', 'email', 'nom', 'prenom', 'telephone', 'modefinancement', 'opco',
|
||||
'status', 'class_internal_url', 'session_id', 'price', 'employeur', 'comment',
|
||||
'_id']
|
||||
'_id', 'client_rattachement_id', 'adresse', 'code_postal', 'ville', 'pays',]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -361,34 +370,41 @@ def UpdateStagiairetoClass(diction):
|
|||
user_nom = str(diction['nom']).strip()
|
||||
|
||||
if ("price" in diction.keys()):
|
||||
if diction['price']:
|
||||
mydata['price'] = str(diction['price']).strip()
|
||||
mydata['price'] = str(diction['price']).strip()
|
||||
|
||||
if ("employeur" in diction.keys()):
|
||||
if diction['employeur']:
|
||||
mydata['employeur'] = str(diction['employeur']).strip()
|
||||
mydata['employeur'] = str(diction['employeur']).strip()
|
||||
|
||||
user_prenom = ""
|
||||
if ("prenom" in diction.keys()):
|
||||
if diction['prenom']:
|
||||
mydata['prenom'] = str(diction['prenom']).strip()
|
||||
user_prenom = str(diction['prenom']).strip()
|
||||
mydata['prenom'] = str(diction['prenom']).strip()
|
||||
user_prenom = str(diction['prenom']).strip()
|
||||
|
||||
if ("telephone" in diction.keys()):
|
||||
if diction['telephone']:
|
||||
mydata['telephone'] = str(diction['telephone']).strip()
|
||||
mydata['telephone'] = str(diction['telephone']).strip()
|
||||
|
||||
if ("modefinancement" in diction.keys()):
|
||||
if diction['modefinancement']:
|
||||
mydata['modefinancement'] = str(diction['modefinancement']).strip()
|
||||
mydata['modefinancement'] = str(diction['modefinancement']).strip()
|
||||
|
||||
if ("opco" in diction.keys()):
|
||||
if diction['opco']:
|
||||
mydata['opco'] = str(diction['opco']).strip()
|
||||
mydata['opco'] = str(diction['opco']).strip()
|
||||
|
||||
if ("price" in diction.keys()):
|
||||
if diction['price']:
|
||||
mydata['price'] = str(diction['price']).strip()
|
||||
mydata['price'] = str(diction['price']).strip()
|
||||
|
||||
if ("adresse" in diction.keys()):
|
||||
mydata['adresse'] = str(diction['adresse']).strip()
|
||||
|
||||
if ("code_postal" in diction.keys()):
|
||||
mydata['code_postal'] = str(diction['code_postal']).strip()
|
||||
|
||||
if ("ville" in diction.keys()):
|
||||
mydata['ville'] = str(diction['ville']).strip()
|
||||
|
||||
if ("pays" in diction.keys()):
|
||||
mydata['pays'] = str(diction['pays']).strip()
|
||||
|
||||
|
||||
|
||||
new_status = ""
|
||||
if ("status" in diction.keys()):
|
||||
|
@ -398,8 +414,11 @@ def UpdateStagiairetoClass(diction):
|
|||
|
||||
|
||||
if ("comment" in diction.keys()):
|
||||
if diction['comment']:
|
||||
mydata['comment'] = str(diction['comment']).strip()
|
||||
mydata['comment'] = str(diction['comment']).strip()
|
||||
|
||||
|
||||
if ("client_rattachement_id" in diction.keys()):
|
||||
mydata['client_rattachement_id'] = str(diction['client_rattachement_id']).strip()
|
||||
|
||||
|
||||
"""
|
||||
|
@ -454,6 +473,7 @@ def UpdateStagiairetoClass(diction):
|
|||
email_data['comment'] = diction['comment']
|
||||
|
||||
# ici recup du titre
|
||||
lms_class_code = ""
|
||||
for local_tmp_myclass in MYSY_GV.dbname['myclass'].find(
|
||||
{'internal_url': str(myinternal_url)}):
|
||||
|
||||
|
@ -462,159 +482,111 @@ def UpdateStagiairetoClass(diction):
|
|||
local_title = local_tmp_myclass['title']
|
||||
email_data['title'] = local_title
|
||||
|
||||
|
||||
if ("lms_class_code" in local_tmp_myclass.keys() ):
|
||||
lms_class_code = local_tmp_myclass['lms_class_code']
|
||||
|
||||
|
||||
# ici recup des infos de la session
|
||||
local_query = {'code_session':str(mysession_id), 'class_internal_url':str(diction['class_internal_url']).strip(), 'valide':'1'}
|
||||
print("### local_query = "+str(local_query))
|
||||
|
||||
|
||||
for local_tmp_session in MYSY_GV.dbname['session_formation'].find(local_query):
|
||||
local_tmp_session_count = MYSY_GV.dbname['session_formation'].count_documents(local_query)
|
||||
if( local_tmp_session_count <= 0 ):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Aucune session de formation pour "+str(local_query))
|
||||
return False, "Impossible de mettre à jour le stagiaire, Cette session de formation n'est pas valide "
|
||||
|
||||
local_date_du = ""
|
||||
if ("date_debut" in local_tmp_session.keys() and local_tmp_session['date_debut']):
|
||||
local_date_du = str(local_tmp_session['date_debut'])[0:10]
|
||||
email_data['date_du'] = local_date_du
|
||||
if (local_tmp_session_count > 1):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Plusieurs session existent pour ce code sessions " + str(local_query))
|
||||
return False, "Impossible de mettre à jour le stagiaire, Cette session de formation n'est pas valide (2) "
|
||||
|
||||
|
||||
local_date_au = ""
|
||||
if ("date_fin" in local_tmp_session.keys() and local_tmp_session['date_fin']):
|
||||
local_date_au = str(local_tmp_session['date_fin'])[0:10]
|
||||
email_data['date_au'] = local_date_au
|
||||
|
||||
local_adresse = ""
|
||||
if ("adresse" in local_tmp_session.keys() and local_tmp_session['adresse']):
|
||||
local_adresse = local_tmp_session['adresse']
|
||||
email_data['adresse'] = local_adresse
|
||||
if ( diction['status'] == "1" ):
|
||||
# Il s'agit d'envoyer le message de confirmation d'une inscription
|
||||
local_status, local_message = email_session.incription_training_confirmation_mail(email_data)
|
||||
|
||||
local_cp= ""
|
||||
if ("code_postal" in local_tmp_session.keys() and local_tmp_session['code_postal']):
|
||||
local_cp = local_tmp_session['code_postal']
|
||||
email_data['code_postal'] = local_cp
|
||||
""""
|
||||
Inscription sur le LMS :
|
||||
Si la session de formation possede un code de formation lms 'lms_class_code'
|
||||
|
||||
local_ville = ""
|
||||
if ("ville" in local_tmp_session.keys() and local_tmp_session['ville']):
|
||||
local_ville = local_tmp_session['ville']
|
||||
email_data['ville'] = local_ville
|
||||
Alors cela veut dire que c'est une formation qui est gérée avec le LMS de MYSY.
|
||||
Donc l'inscription va generer :
|
||||
1 - La creation du compte LMS participant
|
||||
2 - L'inscription de l'utilisateur à la formation.
|
||||
|
||||
local_distance = ""
|
||||
if ("distantiel" in local_tmp_session.keys() and local_tmp_session['distantiel']):
|
||||
local_distance = local_tmp_session['distantiel']
|
||||
email_data['distantiel'] = local_distance
|
||||
"""
|
||||
if( lms_class_code.strip() != ""):
|
||||
print(" ### Debut creation lms_class_code.strip() pour le code class ", lms_class_code)
|
||||
new_diction = {}
|
||||
new_diction['token'] = diction['token']
|
||||
new_diction['lastname'] = user_nom
|
||||
new_diction['firstname'] = user_prenom
|
||||
new_diction['email'] = myemail
|
||||
new_diction['password'] = secrets.token_urlsafe(6)
|
||||
new_diction['locked'] = "0"
|
||||
|
||||
#split_mail_tab = str(myemail).split('@')
|
||||
#new_diction['username'] = split_mail_tab[0]
|
||||
|
||||
new_diction['username'] = myemail
|
||||
|
||||
|
||||
local_presence = ""
|
||||
if ("presentiel" in local_tmp_session.keys() and local_tmp_session['presentiel']):
|
||||
local_presence = local_tmp_session['presentiel']
|
||||
email_data['presentiel'] = local_presence
|
||||
local_status, local_message, local_participant_lms_id = mys_lms.Create_MySy_LMS_Apprenant(new_diction)
|
||||
|
||||
local_formateur = ""
|
||||
if ("formateur" in local_tmp_session.keys() and local_tmp_session['formateur']):
|
||||
local_formateur = local_tmp_session['formateur']
|
||||
email_data['formateur'] = local_formateur
|
||||
|
||||
distantiel = ""
|
||||
if ("distantiel" in local_tmp_session.keys() and local_tmp_session['distantiel']):
|
||||
distantiel = local_tmp_session['distantiel']
|
||||
email_data['distantiel'] = distantiel
|
||||
|
||||
presentiel = ""
|
||||
if ("presentiel" in local_tmp_session.keys() and local_tmp_session['presentiel']):
|
||||
presentiel = local_tmp_session['presentiel']
|
||||
email_data['presentiel'] = presentiel
|
||||
|
||||
lms_class_code = ""
|
||||
if ("lms_class_code" in local_tmp_session.keys() and local_tmp_session['lms_class_code']):
|
||||
lms_class_code = local_tmp_session['lms_class_code']
|
||||
|
||||
session_ondemande = ""
|
||||
if ("session_ondemande" in local_tmp_session.keys() and local_tmp_session['session_ondemande']):
|
||||
session_ondemande = local_tmp_session['session_ondemande']
|
||||
email_data['session_ondemande'] = session_ondemande
|
||||
if( local_status is False ):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) +" WARNING : le compte LSM n'a pas été correctement crée")
|
||||
return_message = return_message + " le compte LSM n'a pas été correctement crée. "
|
||||
else:
|
||||
# Mettre à jour la collection "inscription" en ajoutant local_participant_lms_id et et le mot de passe
|
||||
print(" ### Mise à jour 'inscription' pour inscription_line_id = ", inscription_line_id,
|
||||
" local_participant_lms_id = ", local_participant_lms_id, " str(new_diction['password'] ", str(new_diction['password']))
|
||||
local_ret_val = MYSY_GV.dbname['inscription'].find_one_and_update({'_id':ObjectId(str(inscription_line_id))},
|
||||
{"$set":{'lms_user_id':str(local_participant_lms_id),
|
||||
'lms_pwd':str(new_diction['password']),
|
||||
'lms_class_code':str(lms_class_code)}
|
||||
},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
if (local_ret_val and local_ret_val['_id']):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le compte LMS du participant a été correctement mis à jour : local_ret_val['_id'] = "+str( local_ret_val['_id']))
|
||||
""""
|
||||
A present, on va proceder à l'inscription à la formation
|
||||
"""
|
||||
print(" ### Debut de l'inscription au à la formation dans le LMS ")
|
||||
new_diction = {}
|
||||
new_diction['token'] = diction['token']
|
||||
new_diction['user_lms_id'] = local_participant_lms_id
|
||||
new_diction['course_code'] = lms_class_code
|
||||
|
||||
|
||||
if ( diction['status'] == "1" ):
|
||||
# Il s'agit d'envoyer le message de confirmation d'une inscription
|
||||
local_status, local_message = email_session.incription_training_confirmation_mail(email_data)
|
||||
|
||||
""""
|
||||
Inscription sur le LMS :
|
||||
Si la session de formation possede un code de formation lms 'lms_class_code'
|
||||
|
||||
Alors cela veut dire que c'est une formation qui est gérée avec le LMS de MYSY.
|
||||
Donc l'inscription va generer :
|
||||
1 - La creation du compte LMS participant
|
||||
2 - L'inscription de l'utilisateur à la formation.
|
||||
|
||||
"""
|
||||
if( lms_class_code.strip() != ""):
|
||||
print(" ### Debut creation lms_class_code.strip() pour le code class ", lms_class_code)
|
||||
new_diction = {}
|
||||
new_diction['token'] = diction['token']
|
||||
new_diction['lastname'] = user_nom
|
||||
new_diction['firstname'] = user_prenom
|
||||
new_diction['email'] = myemail
|
||||
new_diction['password'] = secrets.token_urlsafe(6)
|
||||
new_diction['locked'] = "0"
|
||||
|
||||
#split_mail_tab = str(myemail).split('@')
|
||||
#new_diction['username'] = split_mail_tab[0]
|
||||
|
||||
new_diction['username'] = myemail
|
||||
|
||||
|
||||
local_status, local_message, local_participant_lms_id = mys_lms.Create_MySy_LMS_Apprenant(new_diction)
|
||||
|
||||
if( local_status is False ):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) +" WARNING : le compte LSM n'a pas été correctement crée")
|
||||
return_message = return_message + " le compte LSM n'a pas été correctement crée. "
|
||||
else:
|
||||
# Mettre à jour la collection "inscription" en ajoutant local_participant_lms_id et et le mot de passe
|
||||
print(" ### Mise à jour 'inscription' pour inscription_line_id = ", inscription_line_id,
|
||||
" local_participant_lms_id = ", local_participant_lms_id, " str(new_diction['password'] ", str(new_diction['password']))
|
||||
local_ret_val = MYSY_GV.dbname['inscription'].find_one_and_update({'_id':ObjectId(str(inscription_line_id))},
|
||||
{"$set":{'lms_user_id':str(local_participant_lms_id),
|
||||
'lms_pwd':str(new_diction['password']),
|
||||
'lms_class_code':str(lms_class_code)}
|
||||
},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
if (local_ret_val and local_ret_val['_id']):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le compte LMS du participant a été correctement mis à jour : local_ret_val['_id'] = "+str( local_ret_val['_id']))
|
||||
""""
|
||||
A present, on va proceder à l'inscription à la formation
|
||||
"""
|
||||
print(" ### Debut de l'inscription au à la formation dans le LMS ")
|
||||
new_diction = {}
|
||||
new_diction['token'] = diction['token']
|
||||
new_diction['user_lms_id'] = local_participant_lms_id
|
||||
new_diction['course_code'] = lms_class_code
|
||||
|
||||
|
||||
local_status2, local_message2 = mys_lms.Add_User_To_LMS_Class(new_diction)
|
||||
if (local_status2 is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " WARNING : Impossbile de finaliser l'incription dans le LMS")
|
||||
return_message = return_message + " Impossbile de finaliser l'incription dans le LMS. "
|
||||
else:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " TOP, l'inscription dans le LMS a ete correctement faite")
|
||||
|
||||
local_status2, local_message2 = mys_lms.Add_User_To_LMS_Class(new_diction)
|
||||
if (local_status2 is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " WARNING : Impossbile de finaliser l'incription dans le LMS")
|
||||
return_message = return_message + " Impossbile de finaliser l'incription dans le LMS. "
|
||||
else:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - WARNING : Impossible de mettre à jour le compte LMS ")
|
||||
return_message = return_message + " Impossible de mettre à jour le compte LMS."
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " TOP, l'inscription dans le LMS a ete correctement faite")
|
||||
|
||||
else:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - WARNING : Impossible de mettre à jour le compte LMS ")
|
||||
return_message = return_message + " Impossible de mettre à jour le compte LMS."
|
||||
|
||||
|
||||
|
||||
|
||||
elif ( diction['status'] == "-1" ):
|
||||
# Il s'agit d'envoyer le message de refus d'une inscription
|
||||
local_status, local_message = email_session.incription_training_refused_mail(email_data)
|
||||
elif ( diction['status'] == "-1" ):
|
||||
# Il s'agit d'envoyer le message de refus d'une inscription
|
||||
local_status, local_message = email_session.incription_training_refused_mail(email_data)
|
||||
|
||||
|
||||
|
||||
mycommon.myprint(" Les données du stagiaire ont été correctement mise à jour")
|
||||
if( len(str(return_message)) > 5):
|
||||
return True, "Les données du stagiaire ont été correctement mise à jour. WARNING : "+return_message
|
||||
mycommon.myprint(" Les données du stagiaire ont été correctement mise à jour")
|
||||
if( len(str(return_message)) > 5):
|
||||
return True, "Les données du stagiaire ont été correctement mise à jour. WARNING : "+return_message
|
||||
|
||||
return True, "Les données du stagiaire ont été correctement mise à jour"
|
||||
return True, "Les données du stagiaire ont été correctement mise à jour"
|
||||
|
||||
|
||||
else:
|
||||
|
@ -792,44 +764,58 @@ def SendInscriptionConfirmation(diction):
|
|||
|
||||
|
||||
# 2 - Recuperation des données de l'inscription
|
||||
local_session = MYSY_GV.dbname['inscription'].find({'session_id':str(diction['session_id']),
|
||||
local_inscription = MYSY_GV.dbname['inscription'].find({'session_id':str(diction['session_id']),
|
||||
'email':str(diction['email'])})
|
||||
local_nom = ""
|
||||
if ("nom" in local_session[0].keys()):
|
||||
if local_session[0]['nom']:
|
||||
local_nom = local_session[0]['nom']
|
||||
if ("nom" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['nom']:
|
||||
local_nom = local_inscription[0]['nom']
|
||||
data_mail['nom'] = local_nom
|
||||
|
||||
local_prenom = ""
|
||||
if ("prenom" in local_session[0].keys()):
|
||||
if local_session[0]['prenom']:
|
||||
local_prenom = local_session[0]['prenom']
|
||||
if ("prenom" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['prenom']:
|
||||
local_prenom = local_inscription[0]['prenom']
|
||||
data_mail['prenom'] = local_prenom
|
||||
|
||||
data_mail['email'] = local_session[0]['email']
|
||||
data_mail['email'] = local_inscription[0]['email']
|
||||
|
||||
# 3 - Recuperations des info de la session (a distance, formateur, etc)
|
||||
local_info_session = MYSY_GV.dbname['session_formation'].find({'code_session': str(diction['session_id']),
|
||||
'class_internal_url': str(
|
||||
diction['class_internal_url']),
|
||||
'valide': '1'})
|
||||
|
||||
if (local_info_session is None):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - impossible d'envoyer le mail d'inscription. la session " + str(
|
||||
diction['session_id']) + " est introuvable ")
|
||||
return False, " impossible d'envoyer le mail d'inscription. la session " + str(
|
||||
diction['session_id']) + " est introuvable "
|
||||
|
||||
|
||||
date_du = ""
|
||||
if ("date_du" in local_session[0].keys()):
|
||||
if local_session[0]['date_du']:
|
||||
date_du = local_session[0]['date_du']
|
||||
if ("date_du" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['date_du']:
|
||||
date_du = local_info_session[0]['date_du']
|
||||
data_mail['date_du'] = str(date_du)[0:10]
|
||||
|
||||
date_au = ""
|
||||
if ("date_au" in local_session[0].keys()):
|
||||
if local_session[0]['date_au']:
|
||||
date_au = local_session[0]['date_au']
|
||||
if ("date_au" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['date_au']:
|
||||
date_au = local_info_session[0]['date_au']
|
||||
data_mail['date_au'] = str(date_au)[0:10]
|
||||
|
||||
adresse = ""
|
||||
if ("adresse" in local_session[0].keys()):
|
||||
if local_session[0]['adresse']:
|
||||
adresse = local_session[0]['adresse']
|
||||
if ("adresse" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['adresse']:
|
||||
adresse = local_info_session[0]['adresse']
|
||||
data_mail['adresse'] = adresse
|
||||
|
||||
session_ondemande = ""
|
||||
if ("session_ondemande" in local_session[0].keys()):
|
||||
if local_session[0]['session_ondemande']:
|
||||
session_ondemande = local_session[0]['session_ondemande']
|
||||
if ("session_ondemande" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['session_ondemande']:
|
||||
session_ondemande = local_info_session[0]['session_ondemande']
|
||||
data_mail['session_ondemande'] = session_ondemande
|
||||
|
||||
|
||||
|
@ -902,42 +888,61 @@ def SendPre_InscriptionEmail(diction):
|
|||
str(inspect.stack()[0][3]) + " - impossible d'envoyer le mail de presinscription. la session "+str(diction['session_id'])+" est introuvable ")
|
||||
return False, " impossible d'envoyer le mail de presinscription. la session "+str(diction['session_id'])+" est introuvable "
|
||||
|
||||
code_postal = ""
|
||||
if ("code_postal" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['code_postal']:
|
||||
data_mail['code_postal'] = local_info_session[0]['code_postal']
|
||||
code_postal = local_info_session[0]['code_postal']
|
||||
data_mail['code_postal'] = code_postal
|
||||
|
||||
|
||||
date_debut = ""
|
||||
if ("date_debut" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['date_debut']:
|
||||
data_mail['date_du'] = str(local_info_session[0]['date_debut'])[0:10]
|
||||
date_debut = str(local_info_session[0]['date_debut'])[0:10]
|
||||
data_mail['date_du'] = date_debut
|
||||
|
||||
date_fin = ""
|
||||
if ("date_fin" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['date_fin']:
|
||||
data_mail['date_au'] = str(local_info_session[0]['date_fin'])[0:10]
|
||||
|
||||
date_fin = str(local_info_session[0]['date_fin'])[0:10]
|
||||
data_mail['date_au'] = date_fin
|
||||
|
||||
formateur = ""
|
||||
if ("formateur" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['formateur']:
|
||||
data_mail['formateur'] = local_info_session[0]['formateur']
|
||||
formateur = local_info_session[0]['formateur']
|
||||
data_mail['formateur'] = formateur
|
||||
|
||||
distantiel = ""
|
||||
if ("distantiel" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['distantiel']:
|
||||
data_mail['distantiel'] = local_info_session[0]['distantiel']
|
||||
distantiel = local_info_session[0]['distantiel']
|
||||
data_mail['distantiel'] = distantiel
|
||||
|
||||
presentiel = ""
|
||||
if ("presentiel" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['presentiel']:
|
||||
data_mail['presentiel'] = local_info_session[0]['presentiel']
|
||||
presentiel = local_info_session[0]['presentiel']
|
||||
data_mail['presentiel'] = presentiel
|
||||
|
||||
ville = ""
|
||||
if ("ville" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['ville']:
|
||||
data_mail['ville'] = local_info_session[0]['ville']
|
||||
ville = local_info_session[0]['ville']
|
||||
data_mail['ville'] = ville
|
||||
|
||||
|
||||
adresse = ""
|
||||
if ("adresse" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['adresse']:
|
||||
data_mail['adresse'] = local_info_session[0]['adresse']
|
||||
adresse = local_info_session[0]['adresse']
|
||||
data_mail['adresse'] = adresse
|
||||
|
||||
session_ondemande = ""
|
||||
if ("session_ondemande" in local_info_session[0].keys()):
|
||||
if local_info_session[0]['session_ondemande']:
|
||||
data_mail['session_ondemande'] = local_info_session[0]['session_ondemande']
|
||||
session_ondemande = local_info_session[0]['session_ondemande']
|
||||
data_mail['session_ondemande'] = session_ondemande
|
||||
|
||||
|
||||
#print(" Pre_incription_training_confirmation_mail DATA = ",data_mail )
|
||||
|
@ -1221,7 +1226,7 @@ def DownloadEvaluationList(diction):
|
|||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = field_list = ['token', 'session_id', 'internal_url']
|
||||
field_list_obligatoire = ['token', 'session_id', 'internal_url']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
|
@ -1532,7 +1537,7 @@ def AddStagiairetoClass_mass(file=None, Folder=None, diction=None):
|
|||
# Verification que les noms des colonne sont bien corrects"
|
||||
'''
|
||||
field_list = ['prenom', 'nom', 'employeur', 'telephone', 'email', 'modefinancement',
|
||||
'opco', 'status', 'prix']
|
||||
'opco', 'status', 'prix', 'adresse', 'code_postal', 'ville', 'pays', 'client_rattachement_email', 'client_rattachement_nom']
|
||||
|
||||
|
||||
# Controle du nombre de lignes dans le fichier.
|
||||
|
@ -1595,6 +1600,65 @@ def AddStagiairetoClass_mass(file=None, Folder=None, diction=None):
|
|||
opco = str(df['opco'].values[n])
|
||||
mydata['opco'] = opco
|
||||
|
||||
adresse = ""
|
||||
if ("adresse" in df.keys()):
|
||||
if (str(df['adresse'].values[n])):
|
||||
adresse = str(df['adresse'].values[n])
|
||||
mydata['adresse'] = adresse
|
||||
|
||||
code_postal = ""
|
||||
if ("code_postal" in df.keys()):
|
||||
if (str(df['code_postal'].values[n])):
|
||||
code_postal = str(df['code_postal'].values[n])
|
||||
mydata['code_postal'] = code_postal
|
||||
|
||||
ville = ""
|
||||
if ("ville" in df.keys()):
|
||||
if (str(df['ville'].values[n])):
|
||||
ville = str(df['ville'].values[n])
|
||||
mydata['ville'] = ville
|
||||
|
||||
pays = ""
|
||||
if ("pays" in df.keys()):
|
||||
if (str(df['pays'].values[n])):
|
||||
pays = str(df['pays'].values[n])
|
||||
mydata['pays'] = pays
|
||||
|
||||
|
||||
""""
|
||||
Gestion du client de rattachement/
|
||||
Avec l'email et le nom, on va aller recuperer l'_id du client
|
||||
"""
|
||||
client_rattachement_email = ""
|
||||
if ("client_rattachement_email" in df.keys()):
|
||||
if (str(df['client_rattachement_email'].values[n])):
|
||||
client_rattachement_email = str(df['client_rattachement_email'].values[n])
|
||||
|
||||
|
||||
client_rattachement_nom = ""
|
||||
if ("client_rattachement_nom" in df.keys()):
|
||||
if (str(df['client_rattachement_nom'].values[n])):
|
||||
client_rattachement_nom = str(df['client_rattachement_nom'].values[n])
|
||||
|
||||
local_client_retval_qry = {'email':str(client_rattachement_email), 'nom':str(client_rattachement_nom), 'valide':'1', 'locked':'0'}
|
||||
local_client_retval_count = MYSY_GV.dbname['partner_client'].count_documents(local_client_retval_qry)
|
||||
|
||||
if( local_client_retval_count > 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) +"Ligne : "+str(n) +". Plusieurs clients correspondent aux critère de nom :"+str(client_rattachement_nom)+" et email : "+str(client_rattachement_email))
|
||||
return False, "Ligne : "+str(n) +". Plusieurs clients correspondent aux critère de nom :"+str(client_rattachement_nom)+" et email : "+str(client_rattachement_email)
|
||||
|
||||
if (local_client_retval_count < 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + "Ligne : "+str(n) +". Aucun client ne repond aux critères de nom :" + str(
|
||||
client_rattachement_nom) + " et email : " + str(client_rattachement_email))
|
||||
return False, "Ligne : "+str(n) +". Aucun client ne repond aux critères de nom :" + str(
|
||||
client_rattachement_nom) + " et email : " + str(client_rattachement_email)
|
||||
|
||||
local_client_retval_data = MYSY_GV.dbname['partner_client'].find_one(local_client_retval_qry)
|
||||
if( local_client_retval_data is not None ):
|
||||
mydata['client_rattachement_id'] = local_client_retval_data['_id']
|
||||
|
||||
|
||||
mydata['status'] = str(df['status'].values[n]).strip()
|
||||
if( str(mydata['status']) != "0" and str(mydata['status']) != "1" and str(mydata['status']) != "2"):
|
||||
|
@ -3272,7 +3336,7 @@ def getRecodedStagiaireImage_from_front(diction=None):
|
|||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(partner_images))
|
||||
|
||||
print(" ### getRecodedStagiaireImage_from_front RetObject = ", RetObject)
|
||||
|
||||
return True, RetObject
|
||||
|
||||
except Exception as e:
|
||||
|
@ -3482,9 +3546,23 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
|
||||
# Recuperation des informations de la session
|
||||
local_qry = {'class_internal_url':str(retVal['class_internal_url']), 'code_session':str(retVal['session_id']), 'valide':'1'}
|
||||
|
||||
count_session = MYSY_GV.dbname['session_formation'].count_documents(local_qry)
|
||||
|
||||
client_rattachement_id = ""
|
||||
client_rattachement_nom = ""
|
||||
# Si il a un client rattacher, recuperation des information du client
|
||||
if( "client_rattachement_id" in retVal.keys()):
|
||||
if( retVal['client_rattachement_id']):
|
||||
client_retval = MYSY_GV.dbname['partner_client'].find_one({'id':ObjectId( retVal['client_rattachement_id']),
|
||||
'valide':'1', 'locked':'0'})
|
||||
|
||||
if( client_retval is not None):
|
||||
client_rattachement_id= client_retval['_id']
|
||||
client_rattachement_nom = client_retval['nom']
|
||||
|
||||
val['client_rattachement_id'] = client_rattachement_id
|
||||
val['client_rattachement_nom'] = client_rattachement_nom
|
||||
|
||||
if(count_session != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
|
|
2272
Log/log_file.log
2272
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -648,6 +648,7 @@ def GetAllValideSessionPartner_List(diction):
|
|||
val['id'] = str(cpt)
|
||||
cpt = cpt + 1
|
||||
val['class_internal_url'] = retVal['class_internal_url']
|
||||
val['_id'] = retVal['_id']
|
||||
val['code_session'] = retVal['code_session']
|
||||
|
||||
val['session_etape'] = retVal['session_etape']
|
||||
|
@ -797,6 +798,7 @@ def GetAllValideSessionPartner_List_filter_like(diction):
|
|||
val = {}
|
||||
val['id'] = str(cpt)
|
||||
cpt = cpt + 1
|
||||
val['_id'] = retVal['_id']
|
||||
val['class_internal_url'] = retVal['class_internal_url']
|
||||
val['code_session'] = retVal['code_session']
|
||||
val['session_etape'] = retVal['session_etape']
|
||||
|
|
4
main.py
4
main.py
|
@ -3618,6 +3618,8 @@ if __name__ == '__main__':
|
|||
mycommon.myprint("++ FLASK PORT " + str(MYSY_GV.MYSY_PORT_DEV) + " ++")
|
||||
mycommon.myprint("++ LMS_BAS_URL " + str(MYSY_GV.LMS_BAS_URL) + " ++")
|
||||
|
||||
"""
|
||||
/!\ Dasactivé en dev pour pas consommer de ressource pr rien.
|
||||
scheduler = BackgroundScheduler()
|
||||
# Create the job
|
||||
scheduler.add_job(func=Flask_Cron_Strip_Get_Customer_Abonnement_Data, trigger="interval", minutes=5)
|
||||
|
@ -3626,7 +3628,7 @@ if __name__ == '__main__':
|
|||
|
||||
# /!\ IMPORTANT /!\ : Shut down the scheduler when exiting the app
|
||||
atexit.register(lambda: scheduler.shutdown())
|
||||
|
||||
"""
|
||||
app.run(host='localhost', port=MYSY_GV.MYSY_PORT_DEV, debug=True, threaded=True)
|
||||
# Create the background scheduler
|
||||
|
||||
|
|
229
prj_common.py
229
prj_common.py
|
@ -2877,132 +2877,183 @@ def GetAttendeeDetail_perSession(diction):
|
|||
|
||||
RetObject = []
|
||||
|
||||
qry = {'session_id':str(diction['session_id']),'email':str(diction['attendee_email']),
|
||||
qry_filter = {'session_id':str(diction['session_id']),'email':str(diction['attendee_email']),
|
||||
'class_internal_url':str(diction['internal_url']),}
|
||||
|
||||
print(" ici qry = ",qry)
|
||||
|
||||
|
||||
|
||||
pipe_qry = ([{'$match':qry_filter},
|
||||
{'$lookup':
|
||||
{
|
||||
'from': 'session_formation',
|
||||
'let': {'session_id': "$session_id", 'class_internal_url': '$class_internal_url'},
|
||||
|
||||
'pipeline': [
|
||||
{'$match':
|
||||
{'$expr':
|
||||
{'$and':
|
||||
[
|
||||
{'$eq': ["$code_session", "$$session_id"]},
|
||||
{'$eq': ["$class_internal_url", "$$class_internal_url"]},
|
||||
{'$eq': ["$valide", "1"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
],
|
||||
'as': 'inscription_collectoin'
|
||||
}
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
|
||||
print(" ### GetAttendeeDetail_perSession ici pipe_qry = ",pipe_qry)
|
||||
# Recuperation des infos de la formation
|
||||
local_Insc_retval = MYSY_GV.dbname['inscription'].find_one({'session_id':str(diction['session_id']),
|
||||
"""local_Insc_retval = MYSY_GV.dbname['inscription'].find_one({'session_id':str(diction['session_id']),
|
||||
'email':str(diction['attendee_email']),
|
||||
'class_internal_url':str(diction['internal_url']),})
|
||||
"""
|
||||
|
||||
if( local_Insc_retval is None):
|
||||
myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer le recid du partenaire (2)")
|
||||
return False, " Les informations d'identifier la session (2) "
|
||||
for local_Insc_retval in MYSY_GV.dbname['inscription'].aggregate(pipe_qry) :
|
||||
|
||||
my_retrun_dict = {}
|
||||
print(" ### local_Insc_retval == ", local_Insc_retval)
|
||||
|
||||
if ("session_id" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['session_id'] = local_Insc_retval['session_id']
|
||||
if( local_Insc_retval is None):
|
||||
myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer le recid du partenaire (2)")
|
||||
return False, " Les informations d'identifier la session (2) "
|
||||
|
||||
if ("date_du" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['date_du'] = local_Insc_retval['date_du']
|
||||
if ('inscription_collectoin' in local_Insc_retval.keys() and len(local_Insc_retval['inscription_collectoin']) > 0):
|
||||
my_retrun_dict = {}
|
||||
|
||||
if ("date_au" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['date_au'] = local_Insc_retval['date_au']
|
||||
if ("session_id" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['session_id'] = local_Insc_retval['session_id']
|
||||
|
||||
if ("ville" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['ville'] = local_Insc_retval['ville']
|
||||
if ("date_debut" in local_Insc_retval['inscription_collectoin'][0].keys()):
|
||||
my_retrun_dict['date_du'] = str(local_Insc_retval['inscription_collectoin'][0]['date_debut'])[0:10]
|
||||
|
||||
if ("code_postal" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['code_postal'] = local_Insc_retval['code_postal']
|
||||
if ("date_fin" in local_Insc_retval['inscription_collectoin'][0].keys()):
|
||||
my_retrun_dict['date_au'] = str(local_Insc_retval['inscription_collectoin'][0]['date_fin'])[0:10]
|
||||
|
||||
if ("certification_send_date" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['certification_send_date'])):
|
||||
my_retrun_dict['certification_send_date'] = str(local_Insc_retval['certification_send_date'])[0:10]
|
||||
if ("ville" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['ville'] = local_Insc_retval['ville']
|
||||
|
||||
local_adresse = ""
|
||||
if ("adresse" in local_Insc_retval.keys()):
|
||||
local_adresse = local_Insc_retval['adresse']
|
||||
my_retrun_dict['adresse'] = local_adresse
|
||||
if ("code_postal" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['code_postal'] = local_Insc_retval['code_postal']
|
||||
|
||||
local_nom = ""
|
||||
if ("nom" in local_Insc_retval.keys()):
|
||||
local_nom = local_Insc_retval['nom']
|
||||
my_retrun_dict['nom'] = local_nom
|
||||
if ("certification_send_date" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['certification_send_date'])):
|
||||
my_retrun_dict['certification_send_date'] = str(local_Insc_retval['certification_send_date'])[0:10]
|
||||
|
||||
local_prenom = ""
|
||||
if ("prenom" in local_Insc_retval.keys()):
|
||||
local_prenom = local_Insc_retval['prenom']
|
||||
my_retrun_dict['prenom'] = local_prenom
|
||||
local_adresse = ""
|
||||
if ("adresse" in local_Insc_retval.keys()):
|
||||
local_adresse = local_Insc_retval['adresse']
|
||||
my_retrun_dict['adresse'] = local_adresse
|
||||
|
||||
local_employeur = ""
|
||||
if ("employeur" in local_Insc_retval.keys()):
|
||||
local_employeur = local_Insc_retval['employeur']
|
||||
my_retrun_dict['employeur'] = local_employeur
|
||||
local_nom = ""
|
||||
if ("nom" in local_Insc_retval.keys()):
|
||||
local_nom = local_Insc_retval['nom']
|
||||
my_retrun_dict['nom'] = local_nom
|
||||
|
||||
local_telephone = ""
|
||||
if ("telephone" in local_Insc_retval.keys()):
|
||||
local_telephone = local_Insc_retval['telephone']
|
||||
my_retrun_dict['telephone'] = local_telephone
|
||||
local_prenom = ""
|
||||
if ("prenom" in local_Insc_retval.keys()):
|
||||
local_prenom = local_Insc_retval['prenom']
|
||||
my_retrun_dict['prenom'] = local_prenom
|
||||
|
||||
local_email = ""
|
||||
if ("email" in local_Insc_retval.keys()):
|
||||
local_email = local_Insc_retval['email']
|
||||
my_retrun_dict['email'] = local_email
|
||||
local_employeur = ""
|
||||
if ("employeur" in local_Insc_retval.keys()):
|
||||
local_employeur = local_Insc_retval['employeur']
|
||||
my_retrun_dict['employeur'] = local_employeur
|
||||
|
||||
local_modefinancement = ""
|
||||
if ("modefinancement" in local_Insc_retval.keys()):
|
||||
local_modefinancement = local_Insc_retval['modefinancement']
|
||||
my_retrun_dict['modefinancement'] = local_modefinancement
|
||||
local_telephone = ""
|
||||
if ("telephone" in local_Insc_retval.keys()):
|
||||
local_telephone = local_Insc_retval['telephone']
|
||||
my_retrun_dict['telephone'] = local_telephone
|
||||
|
||||
local_opco = ""
|
||||
if ("opco" in local_Insc_retval.keys()):
|
||||
local_opco = local_Insc_retval['opco']
|
||||
my_retrun_dict['opco'] = local_opco
|
||||
local_email = ""
|
||||
if ("email" in local_Insc_retval.keys()):
|
||||
local_email = local_Insc_retval['email']
|
||||
my_retrun_dict['email'] = local_email
|
||||
|
||||
local_class_internal_url = ""
|
||||
if ("class_internal_url" in local_Insc_retval.keys()):
|
||||
local_class_internal_url = local_Insc_retval['class_internal_url']
|
||||
my_retrun_dict['class_internal_url'] = local_class_internal_url
|
||||
local_modefinancement = ""
|
||||
if ("modefinancement" in local_Insc_retval.keys()):
|
||||
local_modefinancement = local_Insc_retval['modefinancement']
|
||||
my_retrun_dict['modefinancement'] = local_modefinancement
|
||||
|
||||
local_status = ""
|
||||
if ("status" in local_Insc_retval.keys()):
|
||||
local_status = local_Insc_retval['status']
|
||||
my_retrun_dict['status'] = local_status
|
||||
local_opco = ""
|
||||
if ("opco" in local_Insc_retval.keys()):
|
||||
local_opco = local_Insc_retval['opco']
|
||||
my_retrun_dict['opco'] = local_opco
|
||||
|
||||
local_price = ""
|
||||
if ("price" in local_Insc_retval.keys()):
|
||||
local_price = local_Insc_retval['price']
|
||||
my_retrun_dict['price'] = local_price
|
||||
local_class_internal_url = ""
|
||||
if ("class_internal_url" in local_Insc_retval.keys()):
|
||||
local_class_internal_url = local_Insc_retval['class_internal_url']
|
||||
my_retrun_dict['class_internal_url'] = local_class_internal_url
|
||||
|
||||
local_inscription_validation_date = ""
|
||||
if ("inscription_validation_date" in local_Insc_retval.keys()):
|
||||
local_inscription_validation_date = local_Insc_retval['inscription_validation_date']
|
||||
my_retrun_dict['inscription_validation_date'] = local_inscription_validation_date
|
||||
local_status = ""
|
||||
if ("status" in local_Insc_retval.keys()):
|
||||
local_status = local_Insc_retval['status']
|
||||
my_retrun_dict['status'] = local_status
|
||||
|
||||
if ("eval_eval" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_eval'])):
|
||||
my_retrun_dict['eval_eval'] = local_Insc_retval['eval_eval']
|
||||
local_price = ""
|
||||
if ("price" in local_Insc_retval['inscription_collectoin'][0].keys()):
|
||||
local_price = local_Insc_retval['inscription_collectoin'][0]['price']
|
||||
my_retrun_dict['price'] = local_price
|
||||
|
||||
if ("eval_note" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_note'])):
|
||||
my_retrun_dict['eval_note'] = local_Insc_retval['eval_note']
|
||||
local_inscription_validation_date = ""
|
||||
if ("inscription_validation_date" in local_Insc_retval.keys()):
|
||||
local_inscription_validation_date = local_Insc_retval['inscription_validation_date']
|
||||
my_retrun_dict['inscription_validation_date'] = local_inscription_validation_date
|
||||
|
||||
if ("eval_pedagogie" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_pedagogie'])):
|
||||
my_retrun_dict['eval_pedagogie'] = local_Insc_retval['eval_pedagogie']
|
||||
if ("eval_eval" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_eval'])):
|
||||
my_retrun_dict['eval_eval'] = local_Insc_retval['eval_eval']
|
||||
|
||||
if ("eval_date" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_date'])):
|
||||
my_retrun_dict['eval_date'] = str(local_Insc_retval['eval_date'])[0:10]
|
||||
if ("eval_note" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_note'])):
|
||||
my_retrun_dict['eval_note'] = local_Insc_retval['eval_note']
|
||||
|
||||
if ("eval_pedagogie" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_pedagogie'])):
|
||||
my_retrun_dict['eval_pedagogie'] = local_Insc_retval['eval_pedagogie']
|
||||
|
||||
if ("eval_date" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['eval_date'])):
|
||||
my_retrun_dict['eval_date'] = str(local_Insc_retval['eval_date'])[0:10]
|
||||
|
||||
client_rattachement_id = ""
|
||||
client_rattachement_nom = ""
|
||||
if ("client_rattachement_id" in local_Insc_retval.keys()):
|
||||
if( local_Insc_retval['client_rattachement_id']):
|
||||
|
||||
local_client_retval_data = MYSY_GV.dbname['partner_client'].find_one({'_id': ObjectId(str(local_Insc_retval['client_rattachement_id'])),
|
||||
'valide': '1', 'locked': '0'}, {'_id':1, 'nom':1})
|
||||
|
||||
if( local_client_retval_data is not None):
|
||||
client_rattachement_id = local_client_retval_data['_id']
|
||||
client_rattachement_nom = local_client_retval_data['nom']
|
||||
|
||||
my_retrun_dict['client_rattachement_id'] = client_rattachement_id
|
||||
my_retrun_dict['client_rattachement_nom'] = client_rattachement_nom
|
||||
|
||||
|
||||
v = local_Insc_retval['_id'].generation_time
|
||||
my_retrun_dict['created_date'] = str(v.strftime("%d/%m/%Y"))
|
||||
v = local_Insc_retval['_id'].generation_time
|
||||
my_retrun_dict['created_date'] = str(v.strftime("%d/%m/%Y"))
|
||||
|
||||
# Recuperation des informations de la formation
|
||||
local_formation = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(local_Insc_retval['class_internal_url'])})
|
||||
# Recuperation des informations de la formation
|
||||
local_formation = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(local_Insc_retval['class_internal_url'])})
|
||||
|
||||
if local_formation is None or local_formation['_id'] is None:
|
||||
myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer les informations de la formation ")
|
||||
return False, " Impossible de recuperer les informations de la formation"
|
||||
if local_formation is None or local_formation['_id'] is None:
|
||||
myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer les informations de la formation ")
|
||||
return False, " Impossible de recuperer les informations de la formation"
|
||||
|
||||
|
||||
|
||||
my_retrun_dict['class_title'] = local_formation['title']
|
||||
my_retrun_dict['class_title'] = local_formation['title']
|
||||
|
||||
RetObject.append(JSONEncoder().encode(my_retrun_dict))
|
||||
RetObject.append(JSONEncoder().encode(my_retrun_dict))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
|
Loading…
Reference in New Issue