05/02/23 - 20h
parent
292501cdd5
commit
a526600b02
|
@ -3,12 +3,15 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="01/02/23 - 22h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Emargement/fichier_presence.pdf" beforeDir="false" afterPath="$PROJECT_DIR$/Emargement/fichier_presence.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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.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_index_bdd_classes.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_index_bdd_classes.py" 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$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -425,6 +425,17 @@ def UpdateStagiairetoClass(diction):
|
|||
local_formateur = local_tmp_session['formateur']
|
||||
email_data['formateur'] = local_formateur
|
||||
|
||||
distantiel = ""
|
||||
if ("distantiel" in local_tmp_session.keys() and local_tmp_session['distantiel']):
|
||||
distantiel = local_tmp_session['distantiel']
|
||||
email_data['distantiel'] = distantiel
|
||||
|
||||
presentiel = ""
|
||||
if ("presentiel" in local_tmp_session.keys() and local_tmp_session['presentiel']):
|
||||
presentiel = local_tmp_session['presentiel']
|
||||
email_data['presentiel'] = presentiel
|
||||
|
||||
|
||||
|
||||
if ( diction['status'] == "1" ):
|
||||
# Il s'agit d'envoyer le message de confirmation d'une inscription
|
||||
|
|
4890
Log/log_file.log
4890
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -376,6 +376,8 @@ def GetActiveSessionFormation_List(diction):
|
|||
myquery['class_internal_url'] = class_internal_url
|
||||
myquery['valide'] = "1"
|
||||
myquery['session_status'] = "true"
|
||||
|
||||
|
||||
RetObject = []
|
||||
|
||||
print(" ### myquery = ", myquery)
|
||||
|
@ -396,9 +398,6 @@ def GetActiveSessionFormation_List(diction):
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print("####RetObject = "+str(RetObject))
|
||||
return True, RetObject
|
||||
|
||||
|
|
40
class_mgt.py
40
class_mgt.py
|
@ -273,10 +273,11 @@ def add_class(diction):
|
|||
if diction['plus_produit']:
|
||||
mydata['plus_produit'] = diction['plus_produit']
|
||||
|
||||
|
||||
local_mots_cle = ""
|
||||
if ("mots_cle" in diction.keys()):
|
||||
if diction['mots_cle']:
|
||||
mydata['mots_cle'] = diction['mots_cle']
|
||||
local_mots_cle = diction['mots_cle']
|
||||
'''
|
||||
Verification du nombre de mots clée : limite MYSY_GV.MAX_KEYWORD (3)
|
||||
'''
|
||||
|
@ -573,8 +574,9 @@ def add_class(diction):
|
|||
eibdd.ela_index_given_classes_title(training_to_index_title)
|
||||
|
||||
# Indexation Title des mots clées
|
||||
print(" ### DEBUT indexation mot clée", )
|
||||
eibdd.ela_index_class_key_word(mydata['external_code'], "keyword")
|
||||
if( local_mots_cle.strip() != ""):
|
||||
print(" ### DEBUT indexation mot clée", )
|
||||
eibdd.ela_index_class_key_word(mydata['external_code'], "keyword")
|
||||
|
||||
|
||||
return True, "La formation a bien été ajoutée"
|
||||
|
@ -1811,6 +1813,11 @@ def get_class(diction):
|
|||
" filt_title = "+str(filt_title))
|
||||
|
||||
text_size = 0
|
||||
"""
|
||||
# Pour facilité l'affichage du front, on va créer une variable qui liste le nombre de pavé existant.
|
||||
A date la liste des champs est : description, plus_produit, objectif, programme, prerequis, session, pourqui
|
||||
"""
|
||||
nb_pave_a_afficher = 0
|
||||
|
||||
for retVal in coll_name.find({'valide':'1','locked':'0','internal_url':internal_url, 'published':'1'},
|
||||
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0, "indexed_title": 0,
|
||||
|
@ -1857,6 +1864,9 @@ def get_class(diction):
|
|||
if ("description" in retVal.keys()):
|
||||
tmp_str = retVal['description']
|
||||
no_html = mycommon.cleanhtml(retVal['description'])
|
||||
nb_pave_a_afficher = nb_pave_a_afficher + 1
|
||||
print(" ### nb_pave_a_afficher , DESCRI ")
|
||||
|
||||
text_size = text_size + len(str(no_html))
|
||||
if (len(retVal['description']) > MYSY_GV.MAX_CARACT_DETAIL):
|
||||
retVal['description'] = tmp_str[:MYSY_GV.MAX_CARACT_DETAIL] + " ..."
|
||||
|
@ -1866,15 +1876,25 @@ def get_class(diction):
|
|||
tmp_str = retVal['objectif']
|
||||
no_html = mycommon.cleanhtml(retVal['objectif'])
|
||||
text_size = text_size + len(str(no_html))
|
||||
nb_pave_a_afficher = nb_pave_a_afficher + 1
|
||||
print(" ### nb_pave_a_afficher , OBJECTIF ")
|
||||
|
||||
|
||||
if (len(retVal['objectif']) > MYSY_GV.MAX_CARACT_DETAIL):
|
||||
retVal['objectif'] = tmp_str[:MYSY_GV.MAX_CARACT_DETAIL] + " ..."
|
||||
|
||||
|
||||
if ("pourqui" in retVal.keys() and retVal['pourqui']):
|
||||
nb_pave_a_afficher = nb_pave_a_afficher + 1
|
||||
print(" ### nb_pave_a_afficher , POURQUI ")
|
||||
|
||||
|
||||
if ("programme" in retVal.keys()):
|
||||
tmp_str = retVal['programme']
|
||||
no_html = mycommon.cleanhtml( retVal['programme'])
|
||||
text_size = text_size + len(str(no_html))
|
||||
nb_pave_a_afficher = nb_pave_a_afficher + 1
|
||||
print(" ### nb_pave_a_afficher , PROGRAMME ")
|
||||
|
||||
if (len(retVal['programme']) > MYSY_GV.MAX_CARACT_DETAIL):
|
||||
retVal['programme'] = tmp_str[:MYSY_GV.MAX_CARACT_DETAIL] + " ..."
|
||||
|
@ -1889,6 +1909,20 @@ def get_class(diction):
|
|||
|
||||
retVal["text_size"] = "1600"
|
||||
|
||||
"""
|
||||
Verifier s'il y a des session des formations actives
|
||||
"""
|
||||
localmyquery = {}
|
||||
localmyquery['class_internal_url'] = internal_url
|
||||
localmyquery['valide'] = "1"
|
||||
localmyquery['session_status'] = "true"
|
||||
count_localmyquery = MYSY_GV.dbname['session_formation'].count_documents(localmyquery)
|
||||
if( count_localmyquery > 0 ):
|
||||
nb_pave_a_afficher = nb_pave_a_afficher + 1
|
||||
print(" ### nb_pave_a_afficher , SESSION ")
|
||||
|
||||
retVal["nb_pave_a_afficher"] = str(nb_pave_a_afficher)
|
||||
|
||||
print(" #### Pour la formation :",internal_url, " text_size = ", str(text_size))
|
||||
#mycommon.myprint(" #### "+str(retVal))
|
||||
user = retVal
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
,index,mots,occurence,moyenne,id_formation,source_field
|
||||
0,0,halal,1,0.33,HIFMI_001,keyword
|
||||
1,1,cherif_key_word,1,0.33,HIFMI_001,keyword
|
||||
2,2,tracabilite,1,0.33,HIFMI_001,keyword
|
||||
0,0,foundation,1,0.5,MYSY_0003,title
|
||||
1,1,agilepm,1,0.5,MYSY_0003,title
|
||||
|
|
|
|
@ -215,8 +215,12 @@ def ela_index_class_key_word(external_code="", source_field = ""):
|
|||
print(" ### external_code = ", external_code)
|
||||
local_class = MYSY_GV.dbname['myclass'].find_one({"external_code": external_code, 'valide':'1', 'locked':'0'})
|
||||
print(" ## local_class = ", local_class)
|
||||
if( local_class is None or local_class['mots_cle'] is None):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Aucune formation à indexer")
|
||||
if( local_class is None ):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Aucune formation à indexer (1) pour "+str(external_code))
|
||||
return False
|
||||
|
||||
if ("mots_cle" not in local_class.keys()):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Aucune formation à indexer (2) pour "+str(external_code))
|
||||
return False
|
||||
|
||||
"""
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
mots occurence moyenne id_formation source_field
|
||||
0 halal 1 0.33 HIFMI_001 keyword
|
||||
1 cherif_key_word 1 0.33 HIFMI_001 keyword
|
||||
2 tracabilite 1 0.33 HIFMI_001 keyword
|
||||
mots occurence moyenne id_formation source_field
|
||||
0 foundation 1 0.5 MYSY_0003 title
|
||||
1 agilepm 1 0.5 MYSY_0003 title
|
|
@ -51,7 +51,7 @@ def incription_training_confirmation_mail(diction):
|
|||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['nom', 'prenom', 'email', 'date_du', 'date_au', 'adresse', 'title']
|
||||
field_list_obligatoire = ['nom', 'prenom', 'email', 'date_du', 'date_au', 'title']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
|
@ -69,11 +69,13 @@ def incription_training_confirmation_mail(diction):
|
|||
Verification si c'est une formation en ligne.
|
||||
auquel cas, l'adresse est du type : enligne"""
|
||||
|
||||
print(" ### Adresse = "+str(diction['adresse']) )
|
||||
adresse_session = str(diction['adresse'])
|
||||
trim_adr = str(diction['adresse']).strip().replace(" ","").lower()
|
||||
if (trim_adr == "enligne"):
|
||||
adresse_session = "enligne"
|
||||
adresse = ""
|
||||
if ("adresse" in diction.keys()):
|
||||
if diction['adresse']:
|
||||
adresse = diction['adresse']
|
||||
|
||||
adresse_session = adresse
|
||||
|
||||
|
||||
"""
|
||||
send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(template_id=1, params={ "nom": str(diction['nom']),
|
||||
|
@ -181,7 +183,7 @@ def incription_training_refused_mail(diction):
|
|||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['nom', 'prenom', 'email', 'date_du', 'date_au', 'adresse', 'title']
|
||||
field_list_obligatoire = ['nom', 'prenom', 'email', 'date_du', 'date_au', 'title', ]
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
|
@ -199,13 +201,25 @@ def incription_training_refused_mail(diction):
|
|||
Verification si c'est une formation en ligne.
|
||||
auquel cas, l'adresse est du type : enligne"""
|
||||
|
||||
print(" ### Adresse = "+str(diction['adresse']) )
|
||||
adresse_session = str(diction['adresse'])
|
||||
trim_adr = str(diction['adresse']).strip().replace(" ","").lower()
|
||||
if (trim_adr == "enligne"):
|
||||
adresse_session = "enligne"
|
||||
my_adress = ""
|
||||
if ("adresse" in diction.keys()):
|
||||
if diction['adresse']:
|
||||
my_adress = diction['adresse']
|
||||
|
||||
presentiel = ""
|
||||
if ("presentiel" in diction.keys()):
|
||||
if diction['presentiel']:
|
||||
presentiel = diction['presentiel']
|
||||
|
||||
distantiel = ""
|
||||
if ("distantiel" in diction.keys()):
|
||||
if diction['distantiel']:
|
||||
distantiel = diction['distantiel']
|
||||
|
||||
|
||||
adresse_session = my_adress
|
||||
|
||||
|
||||
print("debut envoi mail de test ")
|
||||
# on rentre les renseignements pris sur le site du fournisseur
|
||||
|
||||
# msg = MIMEMultipart("alternative")
|
||||
|
@ -230,6 +244,8 @@ def incription_training_refused_mail(diction):
|
|||
"adresse": str(adresse_session),
|
||||
"title": str(diction['title']),
|
||||
"email": str(diction['email']),
|
||||
"distantiel": str(diction['distantiel']),
|
||||
"presentiel": str(diction['presentiel']),
|
||||
"comment": str(diction['comment'])},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue