diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0544225..3fde787 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,11 +1,10 @@ - + - @@ -467,7 +466,6 @@ - @@ -492,6 +490,7 @@ - \ No newline at end of file diff --git a/Log/log_file.log b/Log/log_file.log index 3622ba3..3ed3dea 100644 --- a/Log/log_file.log +++ b/Log/log_file.log @@ -75518,3 +75518,107 @@ INFO:root:2025-05-21 17:00:58.170860 : ++ FLASK PORT 5001 ++ INFO:root:2025-05-21 17:00:58.170860 : ++ LMS_BAS_URL mysy-hosting.com/ ++ WARNING:werkzeug: * Debugger is active! INFO:werkzeug: * Debugger PIN: 566-210-898 +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:13:35.260112 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:13:35.260112 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:13:35.261108 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:13:35.261108 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:13:35.261108 : ++ LMS_BAS_URL mysy-hosting.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 +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:13:55.335776 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:13:55.335776 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:13:55.336787 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:13:55.336787 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:13:55.336787 : ++ LMS_BAS_URL mysy-hosting.com/ ++ +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 566-210-898 +INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\jury_mgt.py', reloading +INFO:werkzeug: * Restarting with stat +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:16:49.803255 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:16:49.803255 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:16:49.803255 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:16:49.803255 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:16:49.803255 : ++ LMS_BAS_URL mysy-hosting.com/ ++ +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 566-210-898 +INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\jury_mgt.py', reloading +INFO:werkzeug: * Restarting with stat +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:17:20.642395 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:17:20.642395 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:17:20.642395 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:17:20.642395 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:17:20.642395 : ++ LMS_BAS_URL mysy-hosting.com/ ++ +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 566-210-898 +INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\jury_mgt.py', reloading +INFO:werkzeug: * Restarting with stat +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:18:33.162782 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:18:33.162782 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:18:33.163788 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:18:33.163788 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:18:33.163788 : ++ LMS_BAS_URL mysy-hosting.com/ ++ +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 566-210-898 +INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\jury_mgt.py', reloading +INFO:werkzeug: * Restarting with stat +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:19:45.503675 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:19:45.504826 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:19:45.504826 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:19:45.504826 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:19:45.504826 : ++ LMS_BAS_URL mysy-hosting.com/ ++ +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 566-210-898 +INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\jury_mgt.py', reloading +INFO:werkzeug: * Restarting with stat +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:21:58.355251 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:21:58.355251 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:21:58.356253 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:21:58.356253 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:21:58.356253 : ++ LMS_BAS_URL mysy-hosting.com/ ++ +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 566-210-898 +INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\jury_mgt.py', reloading +INFO:werkzeug: * Restarting with stat +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +DEBUG:httpx:load_ssl_context verify=True cert=None trust_env=True http2=False +DEBUG:httpx:load_verify_locations cafile='C:\\Users\\billa\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\certifi\\cacert.pem' +INFO:root:2025-05-21 21:22:16.560416 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++ +INFO:root:2025-05-21 21:22:16.560416 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++ +INFO:root:2025-05-21 21:22:16.560416 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++ +INFO:root:2025-05-21 21:22:16.560416 : ++ FLASK PORT 5001 ++ +INFO:root:2025-05-21 21:22:16.560416 : ++ LMS_BAS_URL mysy-hosting.com/ ++ +WARNING:werkzeug: * Debugger is active! +INFO:werkzeug: * Debugger PIN: 566-210-898 +INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\jury_mgt.py', reloading +INFO:werkzeug: * Restarting with stat diff --git a/jury_mgt.py b/jury_mgt.py index a3ac6b8..ce2b339 100644 --- a/jury_mgt.py +++ b/jury_mgt.py @@ -1394,7 +1394,6 @@ def Get_List_jury_With_Filter(diction): 'code': {'$regex': str(diction['code']), "$options": "i"}} - filt_membre_ressource_humaine_id = {} list_membre_ressource_humaine_id = [] if ("membre" in diction.keys()): @@ -1408,7 +1407,7 @@ def Get_List_jury_With_Filter(diction): list_membre_ressource_humaine_id.append(str(tmp_val['_id'])) - print(" ### liste des Id des ressources humaine sont = ", list_membre_ressource_humaine_id) + #print(" ### liste des Id des ressources humaine sont = ", list_membre_ressource_humaine_id) filt_membre_ressource_humaine_id = {'rh_id': {'$in': list_membre_ressource_humaine_id, }} @@ -2313,7 +2312,7 @@ def Add_Update_Jury_Soutenance(diction): """ -Recuperation de la liste des soutenances d'un jury +Recuperation de la liste des soutenances """ def Get_List_Jury_Soutenenace(diction): try: @@ -2467,6 +2466,204 @@ def Get_List_Jury_Soutenenace(diction): return False, " Impossible de récupérer la liste des soutenances " +""" +Recuperation de la liste des soutenances avec des filtre sur +- sur la salle +- l'inscrit +- l'apprenant + +qry : +db.jury_apprenant.aggregate([ + {'$lookup': { + 'from': 'jury_soutenance', + "let": {'jury_soutenance_id': "$jury_soutenance_id", 'partner_owner_recid': '$partner_owner_recid'}, + 'pipeline': [ + {'$match': + {'$expr': + {'$and': + [ + + {'$eq': ["$_id", {'$convert': { + 'input': "$$jury_soutenance_id", + 'to': "objectId", + 'onError': {'error': 'true'}, + 'onNull': {'isnull': 'true'} + }}]}, + + {'$eq': ["$valide", "1"]}, + {'$eq': ["$partner_owner_recid", '$$partner_owner_recid']} + + ] + } + } + }, + + ], + 'as': 'jury_soutenance_collection' + } + }, + { + '$unwind': '$jury_soutenance_collection' + }, + ]) +""" +def Get_List_Jury_Soutenenace_With_Filter(diction): + try: + diction = mycommon.strip_dictionary(diction) + + """ + Verification des input acceptés + """ + field_list = ['token', 'jury_id', 'nom_salle', + 'inscrit_id', 'inscrit_email', + 'apprenant_id', 'apprenant_email' ] + + incom_keys = diction.keys() + for val in incom_keys: + if val not in field_list and val.startswith('my_') is False: + mycommon.myprint(str( + inspect.stack()[0][3]) + " Le champ '" + val + "' n'existe pas") + return False, " Les informations fournies sont incorrectes", + + """ + Verification des champs obligatoires + """ + field_list_obligatoire = ['token', 'jury_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 la liste des arguments ") + return False, " Les informations fournies sont incorrectes", + + """ + Verification de l'identité et autorisation de l'entité qui + appelle cette API + """ + token = "" + if ("token" in diction.keys()): + if diction['token']: + token = diction['token'] + + local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction) + if (local_status is not True): + return local_status, my_partner + + is_jury_valide = MYSY_GV.dbname['jury'].count_documents({'_id':ObjectId(str(diction['jury_id'])), + 'valide':'1', + 'locked':'0', + 'partner_owner_recid':str(my_partner['recid'])}) + + if( is_jury_valide != 1 ): + mycommon.myprint( + str(inspect.stack()[0][ + 3]) + " L'identifiant du jury est invalide ") + return False, " L'identifiant du jury est invalide ", + + jury_data = MYSY_GV.dbname['jury'].find_one({'_id': ObjectId(str(diction['jury_id'])), + 'valide': '1', + 'locked': '0', + 'partner_owner_recid': str(my_partner['recid'])}) + + + """ + Clés de mise à jour + """ + data_cle = {} + data_cle['partner_owner_recid'] = str(my_partner['recid']) + data_cle['valide'] = "1" + data_cle['locked'] = "0" + data_cle['jury_id'] = str(diction['jury_id']) + + RetObject = [] + val_tmp = 0 + + for retval in MYSY_GV.dbname['jury_soutenance'].find(data_cle).sort([("_id", pymongo.DESCENDING), ]): + user = retval + + if( "session_id" in jury_data.keys() ): + user['session_id'] = jury_data['session_id'] + else: + user['session_id'] = "" + + if( "convocation_apprenant_send" not in retval.keys() ): + user["convocation_apprenant_send"] = "" + + if ("convocation_apprenant_date_sending" not in retval.keys()): + user["convocation_apprenant_date_sending"] = "" + + + # Recuperation des agenda associés + soutenance_agenda_id = "" + soutenance_agenda_event_title = "" + soutenance_agenda_event_start = "" + soutenance_agenda_event_end = "" + if( "agenda_id" in retval.keys() and retval['agenda_id'] ): + agenda_data = MYSY_GV.dbname['agenda'].find_one({'_id':ObjectId(str(retval['agenda_id'])), + 'valide':'1', + 'locked':'0', + 'partner_owner_recid':str(my_partner['recid'])}, + {'_id':1, 'event_start':1, 'event_end':1, 'event_title':1}) + + + + soutenance_agenda_id = str(agenda_data['_id']) + soutenance_agenda_event_start = str(agenda_data['event_start']) + soutenance_agenda_event_end = str(agenda_data['event_end']) + soutenance_agenda_event_title = str(agenda_data['event_title']) + + user['soutenance_agenda_id'] = soutenance_agenda_id + user['soutenance_agenda_event_start'] = soutenance_agenda_event_start + user['soutenance_agenda_event_end'] = soutenance_agenda_event_end + user['soutenance_agenda_event_title'] = soutenance_agenda_event_title + + + + user['id'] = str(val_tmp) + val_tmp = val_tmp + 1 + + jury_apprenant = [] + + # Recuperer le nombre de membre + nb_jury_apprenant = MYSY_GV.dbname['jury_apprenant'].count_documents({'partner_owner_recid':str(my_partner['recid']), + 'valide':'1', + 'locked':'0', + 'jury_id':str(retval['jury_id'])}) + user['nb_apprenant'] = str(nb_jury_apprenant) + + for inscrit in MYSY_GV.dbname['jury_apprenant'].find({'partner_owner_recid': str(my_partner['recid']), + 'valide': '1', + 'locked': '0', + 'jury_id': str(retval['jury_id'])}): + + if( inscrit and "inscription_id" in inscrit.keys() and inscrit['inscription_id']): + jury_inscri_data = MYSY_GV.dbname['inscription'].find_one({'_id':ObjectId(str(inscrit['inscription_id'])), + 'valide':'1', + 'partner_owner_recid':str(my_partner['recid'])}, + {'email':1, + 'nom':1, + 'prenom':1}) + + jury_apprenant.append(jury_inscri_data) + + + + user['list_inscrit'] = jury_apprenant + + + RetObject.append(mycommon.JSONEncoder().encode(user)) + + return True, RetObject + + + except Exception as e: + exc_type, exc_obj, exc_tb = sys.exc_info() + mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno)) + return False, " Impossible de récupérer la liste des soutenances " + + + + + """ Recuperer les information d'une soutenance donnée """