27/12/2023 - 23h

master
cherif 2023-12-27 23:22:24 +01:00
parent 5feb575af6
commit 88aab10540
3 changed files with 143 additions and 19 deletions

View File

@ -5,7 +5,6 @@
<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$/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" />
@ -75,13 +74,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00131" summary="zzz">
<created>1697820780940</created>
<option name="number" value="00131" />
<option name="presentableId" value="LOCAL-00131" />
<option name="project" value="LOCAL" />
<updated>1697820780941</updated>
</task>
<task id="LOCAL-00132" summary="zzz">
<created>1697820815600</created>
<option name="number" value="00132" />
@ -418,7 +410,14 @@
<option name="project" value="LOCAL" />
<updated>1703678453791</updated>
</task>
<option name="localTasksCounter" value="180" />
<task id="LOCAL-00180" summary="27/12/2023 - 13h">
<created>1703714268338</created>
<option name="number" value="00180" />
<option name="presentableId" value="LOCAL-00180" />
<option name="project" value="LOCAL" />
<updated>1703714268338</updated>
</task>
<option name="localTasksCounter" value="181" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">

View File

@ -13,6 +13,8 @@ import json
from bson import ObjectId
import re
from datetime import datetime, date
import apprenant_mgt
import prj_common as mycommon
import secrets
import inspect
@ -4666,15 +4668,12 @@ def AcceptAttendeeInscription(diction):
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"
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data({diction})
if (local_status is not True):
return local_status, my_partner
partner_recid = mycommon.get_parnter_recid_from_token(mytoken)
if (partner_recid is False):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de récupérer le recid du partenaire")
return False, "Impossible de récupérer le recid du partenaire"
partner_recid = my_partner['recid']
# 0 - Verifier de l'existance et de la validité de l'inscription (preinscription à refuser)
my_inscription_count = MYSY_GV.dbname['inscription'].count_documents({'_id':ObjectId(str(diction['inscription_id'])),
@ -4777,7 +4776,7 @@ def AcceptAttendeeInscription(diction):
" 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(diction['inscription_id']))},
{'_id': ObjectId(str(diction['inscription_id'])), 'partner_owner_recid':str(my_partner['recid'])},
{"$set": {'lms_user_id': str(local_participant_lms_id),
'lms_pwd': str(new_diction['password']),
'lms_class_code': str(lms_class_code)}
@ -4819,7 +4818,7 @@ def AcceptAttendeeInscription(diction):
ret_val2 = MYSY_GV.dbname['inscription'].find_one_and_update(
{'_id': ObjectId( str(diction['inscription_id'])), 'email': str(diction['email'])},
{'_id': ObjectId( str(diction['inscription_id'])), 'email': str(diction['email']), 'partner_owner_recid':str(my_partner['recid'])},
{"$set": {'status':'1', 'inscription_validation_date':now, 'date_update':now
}},
return_document=ReturnDocument.AFTER,
@ -4909,6 +4908,78 @@ def AcceptAttendeeInscription(diction):
if( return_message.strip() != ""):
return True, return_message
"""
A présent que l'inscription s'est bien passée, on va créer le dossier apprenant
"""
inscription_data = MYSY_GV.dbname['inscription'].find_one({'_id': ObjectId( str(diction['inscription_id'])),
'email': str(diction['email']),
'partner_owner_recid':str(my_partner['recid'])})
new_apprenant_diction = {}
new_apprenant_diction['nom'] = inscription_data['nom']
new_apprenant_diction['email'] = inscription_data['email']
new_apprenant_diction['prenom'] = inscription_data['prenom']
new_apprenant_diction['civilite'] = inscription_data['civilite']
new_apprenant_diction['telephone'] = inscription_data['telephone']
new_apprenant_diction['employeur'] = inscription_data['employeur']
new_apprenant_diction['client_rattachement_id'] = inscription_data['client_rattachement_id']
new_apprenant_diction['adresse'] = inscription_data['adresse']
new_apprenant_diction['code_postal'] = inscription_data['code_postal']
new_apprenant_diction['ville'] = inscription_data['ville']
new_apprenant_diction['pays'] = inscription_data['pays']
new_apprenant_diction['tuteur1_nom'] = inscription_data['tuteur1_nom']
new_apprenant_diction['tuteur1_prenom'] = inscription_data['tuteur1_prenom']
new_apprenant_diction['tuteur1_email'] = inscription_data['tuteur1_email']
new_apprenant_diction['tuteur1_telephone'] = inscription_data['tuteur1_telephone']
new_apprenant_diction['tuteur2_nom'] = inscription_data['tuteur2_nom']
new_apprenant_diction['tuteur2_prenom'] = inscription_data['tuteur2_prenom']
new_apprenant_diction['tuteur2_email'] = inscription_data['tuteur2_email']
new_apprenant_diction['tuteur2_telephone'] = inscription_data['tuteur2_telephone']
new_apprenant_diction['opco'] = inscription_data['opco']
new_apprenant_diction['comment'] = inscription_data['comment']
new_apprenant_diction['tuteur1_adresse'] = inscription_data['tuteur1_adresse']
new_apprenant_diction['tuteur1_cp'] = inscription_data['tuteur1_cp']
new_apprenant_diction['tuteur1_ville'] = inscription_data['tuteur1_ville']
new_apprenant_diction['tuteur1_pays'] = inscription_data['tuteur1_pays']
new_apprenant_diction['tuteur1_include_com'] = inscription_data['tuteur1_include_com']
new_apprenant_diction['tuteur2_adresse'] = inscription_data['tuteur2_adresse']
new_apprenant_diction['tuteur2_cp'] = inscription_data['tuteur2_cp']
new_apprenant_diction['tuteur2_ville'] = inscription_data['tuteur2_ville']
new_apprenant_diction['tuteur2_pays'] = inscription_data['tuteur2_pays']
new_apprenant_diction['tuteur2_include_com'] = inscription_data['tuteur2_include_com']
local_status, local_retval = apprenant_mgt.Add_Apprenant(new_apprenant_diction)
if( local_status is False):
return local_status, local_retval
"""
recuperation de l'id du dossier qui vient d'etre créer
"""
apprenant_data = MYSY_GV.dbname['apprenant'].find_one({'email':str(inscription_data['email']),
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])},
{'_id':1})
if(apprenant_data is None ):
mycommon.myprint(str(
inspect.stack()[0][3]) + " Impossible de récuperer l'identifiant du dossier créé ")
return False, " Impossible de récuperer l'identifiant du dossier créé "
"""
Apres la creation du dossier on met à jour l'inscription en rajoutant l'apprenant_id
"""
ret_val2 = MYSY_GV.dbname['inscription'].find_one_and_update(
{'_id': ObjectId(str(diction['inscription_id'])), 'email': str(diction['email']), 'partner_owner_recid':str(my_partner['recid'])},
{"$set": {'apprenant_id': str(apprenant_data['_id']), 'date_update':str(datetime.now()),
'update_by':str(my_partner['_id'])}},
return_document=ReturnDocument.AFTER,
upsert=False,
)
return True, "L'inscription a été correctement validée"
except Exception as e:

View File

@ -1995939,3 +1995939,57 @@ INFO:werkzeug:127.0.0.1 - - [27/Dec/2023 22:54:40] "POST /myclass/api/GetSession
INFO:werkzeug:127.0.0.1 - - [27/Dec/2023 22:54:40] "POST /myclass/api/Get_List_object_owner_collection_Stored_Files/ HTTP/1.1" 200 -
INFO:root:2023-12-27 22:54:50.228248 : Security check : IP adresse '127.0.0.1' connected
INFO:werkzeug:127.0.0.1 - - [27/Dec/2023 22:54:50] "POST /myclass/api/GetSpecificPartnerAttestation_Certificat/ HTTP/1.1" 200 -
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\Inscription_mgt.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-12-27 23:01:14.086473 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-12-27 23:01:14.086473 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-12-27 23:01:14.086473 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-12-27 23:01:14.086473 : ++ FLASK PORT 5001 ++
INFO:root:2023-12-27 23:01:14.086473 : ++ LMS_BAS_URL mysy-training.com/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 877-541-979
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\Inscription_mgt.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-12-27 23:02:21.547990 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-12-27 23:02:21.547990 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-12-27 23:02:21.547990 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-12-27 23:02:21.547990 : ++ FLASK PORT 5001 ++
INFO:root:2023-12-27 23:02:21.547990 : ++ LMS_BAS_URL mysy-training.com/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 877-541-979
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\Inscription_mgt.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-12-27 23:02:39.696934 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-12-27 23:02:39.696934 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-12-27 23:02:39.696934 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-12-27 23:02:39.696934 : ++ FLASK PORT 5001 ++
INFO:root:2023-12-27 23:02:39.696934 : ++ LMS_BAS_URL mysy-training.com/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 877-541-979
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\Inscription_mgt.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-12-27 23:03:05.049336 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-12-27 23:03:05.049336 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-12-27 23:03:05.049336 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-12-27 23:03:05.056038 : ++ FLASK PORT 5001 ++
INFO:root:2023-12-27 23:03:05.056038 : ++ LMS_BAS_URL mysy-training.com/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 877-541-979
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\Inscription_mgt.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-12-27 23:21:05.680008 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-12-27 23:21:05.681009 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-12-27 23:21:05.681009 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-12-27 23:21:05.681009 : ++ FLASK PORT 5001 ++
INFO:root:2023-12-27 23:21:05.681009 : ++ LMS_BAS_URL mysy-training.com/ ++
INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://localhost:5001
INFO:werkzeug:Press CTRL+C to quit
INFO:werkzeug: * Restarting with stat
INFO:root:2023-12-27 23:21:14.022488 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-12-27 23:21:14.023490 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-12-27 23:21:14.023490 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-12-27 23:21:14.023490 : ++ FLASK PORT 5001 ++
INFO:root:2023-12-27 23:21:14.023490 : ++ LMS_BAS_URL mysy-training.com/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 877-541-979