22/08/23 - 13h

master
cherif 2023-08-22 13:08:59 +02:00
parent 16aa6a4ae6
commit 4e6b2f9d10
8 changed files with 2449 additions and 44 deletions

View File

@ -1,13 +1,15 @@
<?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="21/08/23 - 15h">
<change afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="21/08/23 - 21h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Contact.py" beforeDir="false" afterPath="$PROJECT_DIR$/Contact.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Emargement/test_emargement.pdf" beforeDir="false" afterPath="$PROJECT_DIR$/Emargement/test_emargement.pdf" 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$/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$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ressources_humaines.js.py" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -71,13 +73,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00029" summary="29/0523 - 20h">
<created>1685386019275</created>
<option name="number" value="00029" />
<option name="presentableId" value="LOCAL-00029" />
<option name="project" value="LOCAL" />
<updated>1685386019275</updated>
</task>
<task id="LOCAL-00030" summary="30/05/23 - 22h">
<created>1685477842032</created>
<option name="number" value="00030" />
@ -414,7 +409,14 @@
<option name="project" value="LOCAL" />
<updated>1692623620294</updated>
</task>
<option name="localTasksCounter" value="78" />
<task id="LOCAL-00078" summary="21/08/23 - 21h">
<created>1692643343193</created>
<option name="number" value="00078" />
<option name="presentableId" value="LOCAL-00078" />
<option name="project" value="LOCAL" />
<updated>1692643343194</updated>
</task>
<option name="localTasksCounter" value="79" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -429,7 +431,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="27/07/23 - 23h" />
<MESSAGE value="28/07/23 - 19h" />
<MESSAGE value="29/07/23 - 29h" />
<MESSAGE value="30/07/23 - 17h" />
@ -454,6 +455,7 @@
<MESSAGE value="19/08/23 - 20h30" />
<MESSAGE value="20/08/23 - 23h30" />
<MESSAGE value="21/08/23 - 15h" />
<option name="LAST_COMMIT_MESSAGE" value="21/08/23 - 15h" />
<MESSAGE value="21/08/23 - 21h" />
<option name="LAST_COMMIT_MESSAGE" value="21/08/23 - 21h" />
</component>
</project>

View File

@ -37,7 +37,7 @@ endobj
endobj
7 0 obj
<<
/Author () /CreationDate (D:20230712204900-01'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20230712204900-01'00') /Producer (xhtml2pdf <https://github.com/xhtml2pdf/xhtml2pdf/>)
/Author () /CreationDate (D:20230822120813-01'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20230822120813-01'00') /Producer (xhtml2pdf <https://github.com/xhtml2pdf/xhtml2pdf/>)
/Subject () /Title () /Trapped /False
>>
endobj
@ -48,10 +48,10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I+QYTcD^;k>WdY&f5/2[ZT*.g#,81dKZ5ok_'9cd3U;KG[T+c'&$e?[RDeKKN$;+N8a4>S!26Z;mD='J[hFZI+TZr([?[I[<RF`sghO/T]@laC(Y5uW!FG>3i[=6oDU[HYb+4l!ujI:D?iM6PQ6e#KRqs3K!S/C/`o\LJVLTDO\9FLLAT0H7s9S,WKmNEDn~>endstream
endobj
xref
0 10
@ -68,7 +68,7 @@ xref
trailer
<<
/ID
[<05d2274b5d320fd140a58b23d9409a22><05d2274b5d320fd140a58b23d9409a22>]
[<44c9cae7153c77931f6c043a6c6a4568><44c9cae7153c77931f6c043a6c6a4568>]
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
/Info 7 0 R
@ -76,5 +76,5 @@ trailer
/Size 10
>>
startxref
2707
4772
%%EOF

View File

@ -332,12 +332,20 @@ def UpdateStagiairetoClass(diction):
if retval is False:
return "Err_Connexion", " La session de connexion n'est pas valide"
mydata = {}
user_nom = ""
myemail = ""
if ("email" in diction.keys()):
if diction['email']:
myemail = str(diction['email']).strip()
#query_key['email'] = str(diction['email']).strip()
if( mycommon.isEmailValide(myemail)) :
mydata['email'] = str(diction['email']).strip()
else:
mycommon.myprint(str(inspect.stack()[0][3]) + " - l'adresse email "+str(myemail)+" n'est pas valide")
return False, "- l'adresse email "+str(myemail)+" n'est pas valide "
object_id = ""
if ("_id" in diction.keys()):
@ -366,8 +374,7 @@ def UpdateStagiairetoClass(diction):
mydata = {}
user_nom = ""
""""
/!\ : update du 18/08/2023 : On va autoriser le changement le session de formation.
@ -2424,7 +2431,12 @@ def PrintAttendeeDetail_perSession(diction):
RetObject = []
# Recuperation des infos de la formation
# Recuperation des infos de la l'inscription
qry = {'session_id': str(diction['session_id']),'email': str(diction['attendee_email']),
'class_internal_url':str(diction['internal_url'])}
print(" ### qry = ", qry)
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'])})
@ -2544,7 +2556,8 @@ def PrintAttendeeDetail_perSession(diction):
# Recuperation des infotrmations de la formation
local_formation = MYSY_GV.dbname['myclass'].find_one(
{'internal_url': str(local_Insc_retval['class_internal_url'])})
{'internal_url': str(local_Insc_retval['class_internal_url']),
'partner_owner_recid':str(partner_recid)})
my_local_title = ""
if ("title" in local_formation.keys()):
@ -2552,8 +2565,8 @@ def PrintAttendeeDetail_perSession(diction):
my_retrun_dict['class_title'] = local_formation['title']
my_local_title = local_formation['title']
local_query = {'code_session':str(local_Insc_retval['session_id']), 'valide':'1',
'class_internal_url':str(internal_url)}
local_query = {'_id':ObjectId(str(local_Insc_retval['session_id'])), 'valide':'1',
'partner_owner_recid':str(partner_recid)}
print(" ### local_query = ", local_query)
@ -2723,6 +2736,7 @@ def Evaluation_Class(diction):
mydata = {}
mydata['eval_date'] = str(datetime.now().strftime("%d/%m/%Y, %H:%M:%S"))
mydata['eval_note'] = str(diction['eval_note']).strip()
mydata['eval_status'] = "1"
mydata['eval_eval'] = str(diction['eval_eval']).strip()
mydata['eval_pedagogie'] = str(diction['eval_pedagogie']).strip()
@ -2828,7 +2842,8 @@ def SendTrainingEvaluationEmail(diction):
# Verifier qui la formation n'a pas deja été evaluée
tmp_count = MYSY_GV.dbname['inscription'].count_documents({'session_id': str(diction['session_id']),
'email': str(diction['attendee_email']),
'class_internal_url': str(diction['class_internal_url']),
'class_internal_url': str(diction['class_internal_url'],),
'partner_owner_recid': str(partner_recid),
"eval_date": {"$exists": True}})
if (tmp_count > 0):
@ -2840,7 +2855,9 @@ def SendTrainingEvaluationEmail(diction):
# Recuperation des infos de la formation
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['class_internal_url'])})
'class_internal_url': str(diction['class_internal_url']),
'partner_owner_recid': str(partner_recid),
})
my_retrun_dict = {}
@ -2851,6 +2868,8 @@ def SendTrainingEvaluationEmail(diction):
my_retrun_dict['date_du'] = str(local_Insc_retval['date_du'])[1:10]
my_retrun_dict['date_au'] = str(local_Insc_retval['date_au'])[0:10]
my_retrun_dict['session_id'] = str(local_Insc_retval['_id'])
ville = ""
if ("ville" in local_Insc_retval.keys() and local_Insc_retval['ville']):
ville = local_Insc_retval['ville']
@ -2866,7 +2885,7 @@ def SendTrainingEvaluationEmail(diction):
internal_url = local_Insc_retval['class_internal_url']
my_retrun_dict['internal_url'] = internal_url
print(" ###### LAAA internal_url = ", internal_url)
adresse = ""
if ("adresse" in local_Insc_retval.keys() and local_Insc_retval['adresse']):
@ -2903,7 +2922,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({'code_session': str(diction['session_id']),
local_session_info = MYSY_GV.dbname['session_formation'].find_one({'_id': ObjectId(str(diction['session_id'])),
'valide': '1'})
@ -3406,9 +3425,11 @@ def GetListEvaluation_Session(diction):
RetObject = []
val_tmp = 1
#qry = {'session_id': str(diction['session_id']), 'partner_owner_recid':str(partner_recid)}
# Recuperation des infos de la formation
for local_Insc_retval in MYSY_GV.dbname['inscription'].find({'session_id': str(diction['session_id'])}):
for local_Insc_retval in MYSY_GV.dbname['inscription'].find({'session_id': str(diction['session_id']), 'partner_owner_recid':str(partner_recid)}):
user = {}
user['id'] = str(val_tmp)
val_tmp = val_tmp + 1
@ -3417,27 +3438,35 @@ def GetListEvaluation_Session(diction):
user['nom'] = local_Insc_retval['nom']
user['prenom'] = local_Insc_retval['prenom']
if ("eval_date" in local_Insc_retval.keys()):
if local_Insc_retval['eval_date']:
user['eval_date'] = local_Insc_retval['eval_date']
user['eval_date'] = local_Insc_retval['eval_date']
else:
user['eval_date'] = "---"
if ("eval_eval" in local_Insc_retval.keys()):
if local_Insc_retval['eval_eval']:
user['eval_eval'] = local_Insc_retval['eval_eval']
user['eval_eval'] = local_Insc_retval['eval_eval']
else:
user['eval_eval'] = "---"
if ("eval_status" in local_Insc_retval.keys()):
user['eval_status'] = local_Insc_retval['eval_status']
else:
user['eval_status'] = ""
if ("eval_note" in local_Insc_retval.keys()):
if local_Insc_retval['eval_note']:
user['eval_note'] = local_Insc_retval['eval_note']
user['eval_note'] = local_Insc_retval['eval_note']
else:
user['eval_note'] = "---"
if ("eval_pedagogie" in local_Insc_retval.keys()):
if local_Insc_retval['eval_pedagogie']:
user['eval_pedagogie'] = local_Insc_retval['eval_pedagogie']
user['eval_pedagogie'] = local_Insc_retval['eval_pedagogie']
else:
user['eval_pedagogie'] = ""
RetObject.append(mycommon.JSONEncoder().encode(user))
@ -4340,3 +4369,227 @@ def Get_Statgaire_List_Partner_with_filter(diction):
return False, "Impossible de recuperer la liste des stagiaires"
"""
Cette fonction prend '_id' d'une ligne et retour les information de l'inscription associé.
Un controle sera fait avec le partner_recid
"""
def GetAttendeeDetail_perSession_from_line_id(diction):
try:
field_list_obligatoire = [ 'token', '_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, " Impossible de recuperer les informations detaillées"
my_token = ""
if ("token" in diction.keys()):
if diction['token']:
my_token = diction['token']
# Verifier la validité du token
retval = mycommon.check_partner_token_validity("", my_token)
if retval is False:
return "Err_Connexion", " La session de connexion n'est pas valide"
# Recuperation du recid du partenaire
partner_recid = mycommon.get_parnter_recid_from_token(str(my_token))
if partner_recid is False:
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer le recid du partenaire")
return False, " Les informations d'identification sont invalides"
RetObject = []
qry_filter = {'_id':ObjectId(str(diction['_id'])),'partner_owner_recid':str(partner_recid),}
pipe_qry = ([{'$match':qry_filter},
{'$lookup':
{
'from': 'session_formation',
'let': {'session_id': "$session_id", 'class_internal_url': '$class_internal_url', 'partner_owner_recid':'$partner_owner_recid'},
'pipeline': [
{'$match':
{'$expr':
{'$and':
[
{'$eq': ['$_id', { '$toObjectId': '$$session_id' }]},
{'$eq': ["$valide", "1"]},
{'$eq': ["$partner_owner_recid", '$$partner_owner_recid']}
]
}
}
},
],
'as': 'inscription_collectoin'
}
},
])
print(" ### GetAttendeeDetail_perSession_from_line_id 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']),
'email':str(diction['attendee_email']),
'class_internal_url':str(diction['internal_url']),})
"""
for local_Insc_retval in MYSY_GV.dbname['inscription'].aggregate(pipe_qry) :
print(" ### local_Insc_retval laa== ", local_Insc_retval)
if( local_Insc_retval is None):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer le recid du partenaire (2)")
return False, " Les informations d'identifier la session (2) "
if ('inscription_collectoin' in local_Insc_retval.keys() and len(local_Insc_retval['inscription_collectoin']) > 0):
my_retrun_dict = {}
if ("session_id" in local_Insc_retval.keys()):
my_retrun_dict['session_id'] = local_Insc_retval['session_id']
if ("code_session" in local_Insc_retval['inscription_collectoin'][0].keys()):
my_retrun_dict['code_session'] = str(local_Insc_retval['inscription_collectoin'][0]['code_session'])
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 ("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 ("ville" in local_Insc_retval.keys()):
my_retrun_dict['ville'] = local_Insc_retval['ville']
if ("code_postal" in local_Insc_retval.keys()):
my_retrun_dict['code_postal'] = local_Insc_retval['code_postal']
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_adresse = ""
if ("adresse" in local_Insc_retval.keys()):
local_adresse = local_Insc_retval['adresse']
my_retrun_dict['adresse'] = local_adresse
local_nom = ""
if ("nom" in local_Insc_retval.keys()):
local_nom = local_Insc_retval['nom']
my_retrun_dict['nom'] = local_nom
local_prenom = ""
if ("prenom" in local_Insc_retval.keys()):
local_prenom = local_Insc_retval['prenom']
my_retrun_dict['prenom'] = local_prenom
local_employeur = ""
if ("employeur" in local_Insc_retval.keys()):
local_employeur = local_Insc_retval['employeur']
my_retrun_dict['employeur'] = local_employeur
local_telephone = ""
if ("telephone" in local_Insc_retval.keys()):
local_telephone = local_Insc_retval['telephone']
my_retrun_dict['telephone'] = local_telephone
local_email = ""
if ("email" in local_Insc_retval.keys()):
local_email = local_Insc_retval['email']
my_retrun_dict['email'] = local_email
local_modefinancement = ""
if ("modefinancement" in local_Insc_retval.keys()):
local_modefinancement = local_Insc_retval['modefinancement']
my_retrun_dict['modefinancement'] = local_modefinancement
local_opco = ""
if ("opco" in local_Insc_retval.keys()):
local_opco = local_Insc_retval['opco']
my_retrun_dict['opco'] = local_opco
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_status = ""
if ("status" in local_Insc_retval.keys()):
local_status = local_Insc_retval['status']
my_retrun_dict['status'] = local_status
local_price = ""
if ("price" in local_Insc_retval.keys()):
local_price = local_Insc_retval['price']
my_retrun_dict['price'] = local_price
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_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_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'] and str(local_Insc_retval['client_rattachement_id']) != 'undefined' ):
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"))
# 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:
mycommon.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']
RetObject.append(mycommon.JSONEncoder().encode(my_retrun_dict))
return True, RetObject
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 les informations detaillées"

File diff suppressed because one or more lines are too long

View File

@ -699,6 +699,19 @@ def Evaluation_training_confirmation_mail(diction):
smtpserver.close()
print(" Email envoyé " + str(val))
"""
Apres l'envoi de la demande d'evaluation
on met à jour le statut 'eval_statut' à 0 (envoyé)
"""
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
MYSY_GV.dbname['inscription'].find_one_and_update()
ret_val2 = MYSY_GV.dbname['inscription'].find_one_and_update(
{'_id': ObjectId(str(diction['session_id'])), 'valide': '1', },
{"$set": {'eval_status': '0', 'date_demande_eval': now, 'date_update': now}},
return_document=ReturnDocument.AFTER,
upsert=False,
)
return True, " Email bien envoyé"
except Exception as e:

View File

@ -1797,7 +1797,22 @@ def SendEmargementMail( diction):
print("email = " + str(val_emarge['email']))
# recuperation du titre de la formation
local_class_title = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(val_emarge['class_internal_url']) })
local_class_title = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(val_emarge['class_internal_url']),
'partner_owner_recid':str(partner_recid), 'valide':'1', 'locked':'0'})
if( local_class_title is None):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Aucune formation valide ")
return False, " La formation n'est pas valide"
# recuperation du titre de la session
local_session_data = MYSY_GV.dbname['session_formation'].find_one(
{'_id': ObjectId(str(val_emarge['session_id'])),
'partner_owner_recid': str(partner_recid), 'valide': '1',})
if (local_session_data is None):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Aucune session valide ")
return False, " La session de formation n'est pas valide"
print("debut envoi mail de test ")
@ -1832,6 +1847,7 @@ def SendEmargementMail( diction):
"class_title": str(local_class_title['title']),
"date": str(val_emarge['date']),
"session": "Matinée",
"code_session":str(local_session_data['code_session']),
"mysyurl": str(myurl),
},
@ -1872,6 +1888,7 @@ def SendEmargementMail( diction):
"class_title": str(local_class_title['title']),
"date": str(val_emarge['date']),
"session": "Après-midi",
"code_session": str(local_session_data['code_session']),
"mysyurl": str(myurl),
},

View File

@ -99,8 +99,17 @@ def CreateTableauEmargement(diction):
ville = ""
code_postal = ""
adresse = ""
for tmp_val in MYSY_GV.dbname['session_formation'].find({"class_internal_url":str(class_internal_url),
"formation_session_id": str(session_id)}):
qry = {"_id":ObjectId(str(session_id)), "valide": "1"}
session_formation_count = MYSY_GV.dbname['session_formation'].count_documents({"_id":ObjectId(str(session_id)), "valide": "1"})
if( session_formation_count <= 0 ):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - Aucune session de formation valide ")
return False, "Aucune session de formation valide "
for tmp_val in MYSY_GV.dbname['session_formation'].find({"_id":ObjectId(str(session_id)),
"valide": "1"}):
date_du = str(tmp_val['date_debut'])[0:10]
@ -456,7 +465,7 @@ def GerneratePDFEmargementList(diction):
## Recuperation des données
coll_emargement = MYSY_GV.dbname['emargement']
#print("### query_get_data = " + str(query_get_data))
print("### query_get_data = " + str(query_get_data))
tab_users = []
for val_tmp in coll_emargement.find(query_get_data).sort([("date", pymongo.ASCENDING)]):
@ -477,6 +486,11 @@ def GerneratePDFEmargementList(diction):
for val_tmp in MYSY_GV.dbname['myclass'].find({'internal_url': str(myclass_internal_url)}):
class_title = val_tmp['title']
## Recuperation des info de la sessop,
code_session = ""
for val_tmp_2 in MYSY_GV.dbname['session_formation'].find({'_id': ObjectId(str(mysession_id))}):
code_session = val_tmp_2['code_session']
mytoday = datetime.today().strftime("%d/%m/%Y")
#print(' ### class_title = ' + str(class_title))
@ -490,6 +504,7 @@ def GerneratePDFEmargementList(diction):
"data": {
"title": str(class_title),
"date": str(mytoday),
"code_session":str(code_session),
},
"user": tab_users
}

14
main.py
View File

@ -3624,6 +3624,20 @@ def Get_Statgaire_List_Partner_with_filter():
return jsonify(status=status, message=retval)
"""
API qui recupere les informations d'une inscription en partant de '_id' de la ligne
"""
@app.route('/myclass/api/GetAttendeeDetail_perSession_from_line_id/', methods=['POST','GET'])
@crossdomain(origin='*')
def GetAttendeeDetail_perSession_from_line_id():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### GetAttendeeDetail_perSession_from_line_id payload = ",payload)
status, retval = inscription.GetAttendeeDetail_perSession_from_line_id(payload)
return jsonify(status=status, message=retval)
"""
API qui ajoute une ressource humaine
"""