14/08/23 - 16h30
parent
a5435e2548
commit
ab53c2ef73
|
@ -1,10 +1,10 @@
|
|||
<?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="13/08/23 - 14h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="13/08/23 - 21h30">
|
||||
<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" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -69,13 +69,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00018" summary="12/05/23 - 19h">
|
||||
<created>1683911749819</created>
|
||||
<option name="number" value="00018" />
|
||||
<option name="presentableId" value="LOCAL-00018" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1683911749819</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00019" summary="13/05/23 - 17h">
|
||||
<created>1683991333030</created>
|
||||
<option name="number" value="00019" />
|
||||
|
@ -412,7 +405,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1691927654530</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="67" />
|
||||
<task id="LOCAL-00067" summary="13/08/23 - 21h30">
|
||||
<created>1691955829352</created>
|
||||
<option name="number" value="00067" />
|
||||
<option name="presentableId" value="LOCAL-00067" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1691955829354</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="68" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -427,7 +427,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="09/07/23 - 16h" />
|
||||
<MESSAGE value="09/07/23 - 21h" />
|
||||
<MESSAGE value="10/07/23 - 22h" />
|
||||
<MESSAGE value="12/07/23 - 21h" />
|
||||
|
@ -452,6 +451,7 @@
|
|||
<MESSAGE value="11/08/23 - 16h" />
|
||||
<MESSAGE value="12/08/23 - 12h" />
|
||||
<MESSAGE value="13/08/23 - 14h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="13/08/23 - 14h" />
|
||||
<MESSAGE value="13/08/23 - 21h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="13/08/23 - 21h30" />
|
||||
</component>
|
||||
</project>
|
|
@ -104,7 +104,10 @@ def AddStagiairetoClass(diction):
|
|||
|
||||
"""
|
||||
new_price = "-1" # 0 ==> par defaut
|
||||
for tmp_val in MYSY_GV.dbname['session_formation'].find({"formation_session_id":str(session_id)}):
|
||||
for tmp_val in MYSY_GV.dbname['session_formation'].find({"code_session":str(session_id),
|
||||
'class_internal_url': str(
|
||||
diction['class_internal_url']), 'valide':'1'
|
||||
}):
|
||||
mydata['date_du'] = tmp_val['date_debut']
|
||||
mydata['date_au'] = tmp_val['date_fin']
|
||||
|
||||
|
@ -438,7 +441,7 @@ def UpdateStagiairetoClass(diction):
|
|||
email_data['title'] = local_title
|
||||
|
||||
# ici recup des infos de la session
|
||||
local_query = {'formation_session_id':str(mysession_id)}
|
||||
local_query = {'code_session':str(mysession_id), 'class_internal_url':str(diction['class_internal_url']).strip(), 'valide':'1'}
|
||||
print("### local_query = "+str(local_query))
|
||||
|
||||
|
||||
|
@ -868,7 +871,8 @@ def SendPre_InscriptionEmail(diction):
|
|||
|
||||
|
||||
#3 - Recuperations des info de la session (a distance, formateur, etc)
|
||||
local_info_session = MYSY_GV.dbname['session_formation'].find({'formation_session_id': str(diction['session_id']),
|
||||
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):
|
||||
|
@ -973,7 +977,7 @@ def DownloadParticipantsList(diction):
|
|||
|
||||
|
||||
# Recuperation des données de la session
|
||||
local_session = MYSY_GV.dbname['session_formation'].find_one({'formation_session_id':session_id, 'class_internal_url':internal_url})
|
||||
local_session = MYSY_GV.dbname['session_formation'].find_one({'code_session':session_id, 'class_internal_url':internal_url})
|
||||
|
||||
|
||||
if (local_session is None):
|
||||
|
@ -1227,7 +1231,7 @@ def DownloadEvaluationList(diction):
|
|||
|
||||
|
||||
# Recuperation des données de la session
|
||||
local_session = MYSY_GV.dbname['session_formation'].find_one({'formation_session_id':session_id, 'class_internal_url':internal_url})
|
||||
local_session = MYSY_GV.dbname['session_formation'].find_one({'code_session':session_id, 'class_internal_url':internal_url})
|
||||
|
||||
|
||||
if (local_session is None):
|
||||
|
@ -1611,6 +1615,7 @@ def AddStagiairetoClass_mass(file=None, Folder=None, diction=None):
|
|||
return False, "Impossible d'importer les participants en masse "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction permet d'imprimer/telecharger la fichier d'un inscrit à une session.
|
||||
Cette fonction va utiliser un template pour imprimer le modele
|
||||
|
@ -1777,7 +1782,7 @@ def PrintAttendeeDetail_perSession(diction):
|
|||
my_retrun_dict['class_title'] = local_formation['title']
|
||||
my_local_title = local_formation['title']
|
||||
|
||||
local_query = {'formation_session_id':str(local_Insc_retval['session_id']), 'valide':'1',
|
||||
local_query = {'code_session':str(local_Insc_retval['session_id']), 'valide':'1',
|
||||
'class_internal_url':str(internal_url)}
|
||||
|
||||
print(" ### local_query = ", local_query)
|
||||
|
@ -2128,7 +2133,7 @@ def SendTrainingEvaluationEmail(diction):
|
|||
my_retrun_dict['title'] = local_formation['title']
|
||||
|
||||
# Recuperation des info de session
|
||||
local_session_info = MYSY_GV.dbname['session_formation'].find_one({'formation_session_id': str(diction['session_id']),
|
||||
local_session_info = MYSY_GV.dbname['session_formation'].find_one({'code_session': str(diction['session_id']),
|
||||
'valide': '1'})
|
||||
|
||||
|
||||
|
@ -2208,7 +2213,7 @@ def SendAttendeeCertification(diction):
|
|||
return False, " Vous avez deja envoyé le certificat"
|
||||
|
||||
# Recuperation du type/nom de la certifcation depuis la collecion "session_formation"
|
||||
session_formation = MYSY_GV.dbname['session_formation'].find_one({'formation_session_id': str(diction['session_id']),
|
||||
session_formation = MYSY_GV.dbname['session_formation'].find_one({'code_session': str(diction['session_id']),
|
||||
'class_internal_url': str(
|
||||
diction['class_internal_url']),
|
||||
'valide': "1"})
|
||||
|
@ -2428,7 +2433,7 @@ def PrintAttendeeCertification(diction):
|
|||
|
||||
# Recuperation du type/nom de la certifcation depuis la collecion "session_formation"
|
||||
session_formation = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'formation_session_id': str(diction['session_id']),
|
||||
{'code_session': str(diction['session_id']),
|
||||
'valide': "1", 'class_internal_url':str(diction['internal_url'])})
|
||||
|
||||
if ("attestation_certif" not in session_formation.keys()):
|
||||
|
@ -2715,7 +2720,8 @@ def CancelAttendeeInscription(diction):
|
|||
|
||||
# 2 - Recuperation des données de l'inscription
|
||||
local_inscription = MYSY_GV.dbname['inscription'].find({'session_id': str(diction['session_id']),
|
||||
'email': str(diction['email'])})
|
||||
'email': str(diction['email']),
|
||||
'class_internal_url':str(diction['class_internal_url'])})
|
||||
lms_class_code = ""
|
||||
if ("lms_class_code" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['lms_class_code']:
|
||||
|
@ -2754,7 +2760,7 @@ def CancelAttendeeInscription(diction):
|
|||
|
||||
# Recuperation des données de la session
|
||||
local_session = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'formation_session_id': str(diction['session_id']), 'class_internal_url': str(diction['class_internal_url'])})
|
||||
{'code_session': str(diction['session_id']), 'class_internal_url': str(diction['class_internal_url']), 'valide':'1'})
|
||||
|
||||
if (local_session is None):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer les données de la session ")
|
||||
|
@ -2765,7 +2771,7 @@ def CancelAttendeeInscription(diction):
|
|||
|
||||
|
||||
ret_val2 = MYSY_GV.dbname['inscription'].find_one_and_update(
|
||||
{'session_id': str(diction['session_id']), 'email': str(diction['email'])},
|
||||
{'session_id': str(diction['session_id']), 'email': str(diction['email']), 'class_internal_url':str(diction['class_internal_url'])},
|
||||
{"$set": {'status':'-1', 'inscription_refuse_date':now, 'date_update':now}},
|
||||
return_document=ReturnDocument.AFTER,
|
||||
upsert=False,
|
||||
|
@ -2811,12 +2817,131 @@ def CancelAttendeeInscription(diction):
|
|||
if( return_message.strip() != ""):
|
||||
return True, return_message
|
||||
|
||||
return True, "L'inscription a été correctement annulé"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible d'annuler l'inscription"
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction supprime un stagiaire.
|
||||
/!\ : seuls les preinscrit, ou les inscription annulés (donct status : 0 ou 1)
|
||||
"""
|
||||
def DeleteAttendeeInscription(diction):
|
||||
try:
|
||||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'email', 'class_internal_url', 'session_id']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - : La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Les informations fournies ne sont pas correctes"
|
||||
|
||||
mytoken = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
mytoken = diction['token']
|
||||
|
||||
# Verifier la validité du token
|
||||
retval = mycommon.check_partner_token_validity("", mytoken)
|
||||
if retval is False:
|
||||
return "Err_Connexion", " La session de connexion n'est pas valide"
|
||||
|
||||
partner_recid = mycommon.get_parnter_recid_from_token(mytoken)
|
||||
if (partner_recid is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer le recid du partenaire")
|
||||
return False, "Impossible de recuperer le recid du partenaire"
|
||||
|
||||
data_mail = {}
|
||||
# 1 - Recuperation des données de la formation
|
||||
local_class = MYSY_GV.dbname['myclass'].find({'internal_url': str(diction['class_internal_url'])})
|
||||
data_mail['title'] = local_class[0]['title']
|
||||
class_title = local_class[0]['title']
|
||||
|
||||
# 2 - Recuperation des données de l'inscription
|
||||
local_inscription = MYSY_GV.dbname['inscription'].find({'session_id': str(diction['session_id']),
|
||||
'email': str(diction['email']), 'class_internal_url':str(diction['class_internal_url'])})
|
||||
lms_class_code = ""
|
||||
if ("lms_class_code" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['lms_class_code']:
|
||||
lms_class_code = local_inscription[0]['lms_class_code']
|
||||
|
||||
lms_user_id = ""
|
||||
if ("lms_user_id" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['lms_user_id']:
|
||||
lms_user_id = local_inscription[0]['lms_user_id']
|
||||
|
||||
nom = ""
|
||||
if ("nom" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['nom']:
|
||||
nom = local_inscription[0]['nom']
|
||||
|
||||
prenom = ""
|
||||
if ("prenom" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['prenom']:
|
||||
prenom = local_inscription[0]['prenom']
|
||||
|
||||
email = ""
|
||||
if ("email" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['email']:
|
||||
email = local_inscription[0]['email']
|
||||
|
||||
date_du = ""
|
||||
if ("date_du" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['date_du']:
|
||||
date_du = str(local_inscription[0]['date_du'])[0:10]
|
||||
|
||||
date_au = ""
|
||||
if ("date_au" in local_inscription[0].keys()):
|
||||
if local_inscription[0]['date_au']:
|
||||
date_au = str(local_inscription[0]['date_au'])[0:10]
|
||||
|
||||
|
||||
# Recuperation des données de la session
|
||||
local_session = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'code_session': str(diction['session_id']), 'class_internal_url': str(diction['class_internal_url']), 'valide':'1',})
|
||||
|
||||
if (local_session is None):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer les données de la session ")
|
||||
return False, " Impossible de recuperer les données de la session "
|
||||
|
||||
|
||||
# Verification que l'inscription existe et qu'elle est supprimable (donc status = 0 ou -1)
|
||||
ret_val2_count = MYSY_GV.dbname['inscription'].count_documents(
|
||||
{'session_id': str(diction['session_id']), 'email': str(diction['email']), 'class_internal_url':str(diction['class_internal_url'])},
|
||||
)
|
||||
|
||||
if( ret_val2_count != 1):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de supprimer l'inscription. Il y a plusieurs inscription pour ce mail et cette formation")
|
||||
return False, " Impossible de supprimer l'inscription (1)"
|
||||
|
||||
ret_val2 = MYSY_GV.dbname['inscription'].find_one(
|
||||
{'session_id': str(diction['session_id']), 'email': str(diction['email']),
|
||||
'class_internal_url': str(diction['class_internal_url'])},
|
||||
)
|
||||
|
||||
if( "status" in ret_val2.keys()):
|
||||
if( str(ret_val2['status']) != "0" and str(ret_val2['status']) != "-1"):
|
||||
mycommon.myprint(str(inspect.stack()[0][
|
||||
3]) + " - Impossible de supprimer l'inscription. L'inscription doit etre annulé ou à l'etat 'préinscrit' pour pouvoir etre supprimé")
|
||||
return False, " - Impossible de supprimer l'inscription. L'inscription doit etre annulé ou à l'etat 'préinscrit' pour pouvoir etre supprimé"
|
||||
|
||||
detlete_retval = MYSY_GV.dbname['inscription'].delete_one(
|
||||
{'session_id': str(diction['session_id']), 'email': str(diction['email']),
|
||||
'class_internal_url': str(diction['class_internal_url'])},
|
||||
)
|
||||
|
||||
return True, "L'inscription a été correctement supprimée"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de recuperer la liste des evaluations"
|
||||
return False, " Impossible de supprimer l'insciption "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
@ -2911,8 +3036,8 @@ def Send_LMS_Credentials_to_particpants(diction):
|
|||
|
||||
# Recuperation des données de la session
|
||||
local_session = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'formation_session_id': str(diction['session_id']),
|
||||
'class_internal_url': str(diction['class_internal_url'])})
|
||||
{'code_session': str(diction['session_id']),
|
||||
'class_internal_url': str(diction['class_internal_url']), 'valide':'1',})
|
||||
|
||||
if (local_session is None):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer les données de la session ")
|
||||
|
|
4607
Log/log_file.log
4607
Log/log_file.log
File diff suppressed because it is too large
Load Diff
16
main.py
16
main.py
|
@ -2907,7 +2907,7 @@ def Create_MySy_LMS_Apprenant():
|
|||
|
||||
|
||||
""""
|
||||
Cette API supprime / annule des inscription deja validée
|
||||
Cette API annule des inscription deja validée
|
||||
"""
|
||||
@app.route('/myclass/api/CancelAttendeeInscription/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
|
@ -2918,6 +2918,18 @@ def CancelAttendeeInscription():
|
|||
localStatus, message= inscription.CancelAttendeeInscription(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
""""
|
||||
Cette API supprime defitivement un inscription qui doit etre au statut 'annulé' ou 'prescrit'
|
||||
"""
|
||||
@app.route('/myclass/api/DeleteAttendeeInscription/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def DeleteAttendeeInscription():
|
||||
# On CancelAttendeeInscription le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### DeleteAttendeeInscription : payload = ",payload)
|
||||
localStatus, message= inscription.DeleteAttendeeInscription(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
Cette API permet d'envoyer les identifiants de connexion à la plateforme de plateforme LMS
|
||||
|
@ -2925,7 +2937,7 @@ Cette API permet d'envoyer les identifiants de connexion à la plateforme de pla
|
|||
@app.route('/myclass/api/LMS_Credential_Sending_mail/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def LMS_Credential_Sending_mail():
|
||||
# On CancelAttendeeInscription le corps (payload) de la requete
|
||||
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### LMS_Credential_Sending_mail : payload = ",payload)
|
||||
localStatus, message= inscription.Send_LMS_Credentials_to_particpants(payload)
|
||||
|
|
Loading…
Reference in New Issue