15/05/23 - 23h

master
cherif 2023-05-15 16:11:17 +02:00
parent a414c61dbd
commit 5d350245b1
5 changed files with 106 additions and 10 deletions

View File

@ -5,8 +5,7 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/data_indexees.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data_indexees.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />

View File

@ -1580216,3 +1580216,70 @@ INFO:root:2023-05-14 16:11:49.427879 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-14 16:11:49.427879 : ++ LMS_BAS_URL mysy-training.fr/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 868-184-516
INFO:root:2023-05-15 13:56:24.840952 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-05-15 13:56:24.840952 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-05-15 13:56:24.841943 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-05-15 13:56:24.841943 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-15 13:56:24.841943 : ++ LMS_BAS_URL mysy-training.fr/ ++
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-05-15 13:56:34.194821 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-05-15 13:56:34.194821 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-05-15 13:56:34.194821 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-05-15 13:56:34.194821 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-15 13:56:34.194821 : ++ LMS_BAS_URL mysy-training.fr/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 868-184-516
INFO:root:2023-05-15 13:57:51.024442 : Security check : IP adresse '127.0.0.1' connected
INFO:root:2023-05-15 13:57:51.025695 : Security check : IP adresse '127.0.0.1' connected
INFO:root:2023-05-15 13:57:51.037584 : Security check : IP adresse '127.0.0.1' connected
INFO:werkzeug:127.0.0.1 - - [15/May/2023 13:57:51] "POST /myclass/api/get_List_domaine_formation/ HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [15/May/2023 13:57:51] "POST /myclass/api/Get_Suggested_Word/ HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [15/May/2023 13:57:51] "POST /myclass/api/Get_Suggested_Fr_Cities/ HTTP/1.1" 200 -
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\class_mgt.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-05-15 13:59:12.121187 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-05-15 13:59:12.121187 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-05-15 13:59:12.121187 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-05-15 13:59:12.121187 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-15 13:59:12.121187 : ++ LMS_BAS_URL mysy-training.fr/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 868-184-516
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\class_mgt.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-05-15 15:20:48.777928 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-05-15 15:20:48.778969 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-05-15 15:20:48.778969 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-05-15 15:20:48.778969 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-15 15:20:48.778969 : ++ LMS_BAS_URL mysy-training.fr/ ++
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-05-15 15:21:00.089086 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-05-15 15:21:00.090097 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-05-15 15:21:00.090097 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-05-15 15:21:00.090097 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-15 15:21:00.090097 : ++ LMS_BAS_URL mysy-training.fr/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 868-184-516
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\lms_chamilo\\mysy_lms.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-05-15 15:40:10.158539 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-05-15 15:40:10.158539 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-05-15 15:40:10.158539 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-05-15 15:40:10.158539 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-15 15:40:10.158539 : ++ LMS_BAS_URL mysy-training.fr/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 868-184-516
INFO:werkzeug: * Detected change in 'C:\\Users\\billa\\Documents\\myclass.com\\Siteweb\\Production\\Ela_back\\Back_Office\\lms_chamilo\\mysy_lms.py', reloading
INFO:werkzeug: * Restarting with stat
INFO:root:2023-05-15 15:41:05.146588 : ++++ ENVIRONNEMENT DEVELOPPEMENT ++++
INFO:root:2023-05-15 15:41:05.147599 : ++ DATABASE mongodb://localhost:27017/cherifdb_dev ++
INFO:root:2023-05-15 15:41:05.147599 : ++ DBNAME Database(MongoClient(host=['localhost:27017'], document_class=dict, tz_aware=False, connect=True), 'cherifdb_dev') ++
INFO:root:2023-05-15 15:41:05.147599 : ++ FLASK PORT 5001 ++
INFO:root:2023-05-15 15:41:05.147599 : ++ LMS_BAS_URL mysy-training.fr/ ++
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 868-184-516

View File

@ -28,6 +28,8 @@ Fonction de creation et mise à jour d'une session de formation.
la clée est :
- formation_session_id,
- class_internal_url
/!\ : le champ 'source' definit la source de la creation de la session
"""
def Add_Update_SessionFormation(diction):
try:
@ -42,7 +44,7 @@ def Add_Update_SessionFormation(diction):
'code_postal', 'ville', 'formateur', 'code_session',
'class_internal_url', 'session_status', 'date_debut_inscription', 'date_fin_inscription',
'attestation_certif', "distantiel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
'session_ondemande']
'session_ondemande', 'source']
incom_keys = diction.keys()
for val in incom_keys:
@ -81,6 +83,11 @@ def Add_Update_SessionFormation(diction):
mydata['class_internal_url'] = diction['class_internal_url']
class_internal_url = diction['class_internal_url']
class_source = ""
if ("source" in diction.keys()):
if diction['source']:
class_source = diction['source']
partner_recid = mycommon.get_parnter_recid_from_token(my_token)
if (partner_recid is False):

View File

@ -34,6 +34,10 @@ class JSONEncoder(json.JSONEncoder):
'''
Cette fonction ajoute une formation
elle verifie le token de l'entité qui ajoute la formation.
/!\ : Le champ 'source' permet de savoir le système qui est la source de creation de cette info.
Par exemple : les formation créer depuis le LMS ou les formation envoyées par une
application tiers car on est sur des API.
'''
def add_class(diction):
@ -48,7 +52,7 @@ def add_class(diction):
'price', 'url','duration', 'duration_unit', 'token', 'plus_produit', 'mots_cle','domaine',
'internal_url', 'zone_diffusion', 'metier', 'published', 'img_url', 'objectif',
'programme', 'prerequis', 'note', 'cpf', 'certif', 'class_inscription_url', 'pourqui',
'support', 'img_banner_detail_class']
'support', 'img_banner_detail_class', 'source']
incom_keys = diction.keys()
for val in incom_keys:
@ -124,9 +128,17 @@ def add_class(diction):
mydata['partner_owner_recid'] = user_recid
class_internal_url = ""
class_internal_url_source = ""
if ("internal_url" in diction.keys()):
if diction['internal_url']:
class_internal_url = diction['internal_url']
class_internal_url_source = diction['internal_url']
class_source = ""
if ("source" in diction.keys()):
if diction['source']:
mydata['source'] = diction['source']
class_source = diction['source']
'''
Si l'internal_url reste à vide, alors le système va créer une internal url de la formation
@ -145,6 +157,15 @@ def add_class(diction):
mydata['internal_url'] = class_internal_url
"""
Si j'ai deja un "class_internal_url_source" et j'ai une source = "mysy_lms", alors ceci veut dire
qu'il s'agit d'une formation poussée par le LMS
"""
if(len(str(class_internal_url_source)) > 0 and class_source == "mysy_lms"):
mydata['internal_url'] = class_internal_url_source
print(" ### Il s'agit class_internal_url_source = ", class_internal_url_source, " ### class_source = ", class_source)
if ("external_code" in diction.keys()):
if diction['external_code']:
mydata['external_code'] = diction['external_code']
@ -164,7 +185,7 @@ def add_class(diction):
if ("class_inscription_url" in diction.keys()):
if diction['class_inscription_url']:
mydata['class_inscription_url'] = diction['class_inscription_url']
if ("certif" in diction.keys()):
if diction['certif']:

View File

@ -2933,7 +2933,7 @@ def Create_Update_Class_From_Lms(diction):
if my_partner['nom']:
new_diction['trainer'] = my_partner['nom']
new_diction['source'] = "mysy_lms"
print(" ### new_diction = ", new_diction)
@ -2993,11 +2993,13 @@ def Create_Update_Class_From_Lms(diction):
new_diction_session['presentiel'] = "0"
new_diction_session['session_ondemande'] = "1"
new_diction_session['prix_session'] = ""
new_diction_session['prix_session'] = "0"
new_diction_session['session_status'] = "true"
new_diction_session['adresse'] = "-"
new_diction_session['code_postal'] = "-"
new_diction_session['ville'] = "-"
new_diction_session['adresse'] = ""
new_diction_session['code_postal'] = ""
new_diction_session['ville'] = ""
if ("token" in my_partner.keys()):
if my_partner['token']: