05/04/23 - 21h
parent
2d177fdc74
commit
a4fd2d960d
|
@ -1,17 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="31/03/23 - 11h">
|
||||
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="04/04/23 - 21h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Attestation_Certificat.py" beforeDir="false" afterPath="$PROJECT_DIR$/Attestation_Certificat.py" 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_output_test_file_pandas_2.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" 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$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" 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" />
|
||||
|
@ -77,13 +76,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1668505503001</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="sss">
|
||||
<created>1668505583653</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1668505583653</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="sss - init new pc">
|
||||
<created>1668536872142</created>
|
||||
<option name="number" value="00002" />
|
||||
|
@ -420,7 +412,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1680255185050</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="50" />
|
||||
<task id="LOCAL-00050" summary="04/04/23 - 21h">
|
||||
<created>1680635631969</created>
|
||||
<option name="number" value="00050" />
|
||||
<option name="presentableId" value="LOCAL-00050" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1680635631969</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="51" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -435,7 +434,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="27/01/23 - 15h" />
|
||||
<MESSAGE value="27/01:23 - 19h" />
|
||||
<MESSAGE value="30/01/23 - 22h" />
|
||||
<MESSAGE value="01/02/23 - 22h" />
|
||||
|
@ -460,6 +458,7 @@
|
|||
<MESSAGE value="30/03/23 - 19h30" />
|
||||
<MESSAGE value="30/03/23 - 22h11" />
|
||||
<MESSAGE value="31/03/23 - 11h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="31/03/23 - 11h" />
|
||||
<MESSAGE value="04/04/23 - 21h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="04/04/23 - 21h" />
|
||||
</component>
|
||||
</project>
|
|
@ -110,6 +110,13 @@ def GetSpecificPartnerAttestation_Certificat(diction):
|
|||
return False, "Impossible de recuperer les données de ce template"
|
||||
|
||||
|
||||
if ("preview_url" not in diction.keys()):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Cette session n'a pas de 'preview_url' sur le modele d'attestation ")
|
||||
return False, " Cette session n'a pas de 'preview_url' sur le modele d'attestation "
|
||||
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(ret_val))
|
||||
|
||||
|
||||
|
|
|
@ -256,26 +256,26 @@ def UpdateStagiairetoClass(diction):
|
|||
mytoken = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
mytoken = diction['token']
|
||||
mytoken = str(diction['token']).strip()
|
||||
#query_key['token'] = diction['token']
|
||||
|
||||
myemail = ""
|
||||
if ("email" in diction.keys()):
|
||||
if diction['email']:
|
||||
myemail = diction['email']
|
||||
query_key['email'] = diction['email']
|
||||
myemail = str(diction['email']).strip()
|
||||
query_key['email'] = str(diction['email']).strip()
|
||||
|
||||
myinternal_url = ""
|
||||
if ("class_internal_url" in diction.keys()):
|
||||
if diction['class_internal_url']:
|
||||
myinternal_url = diction['class_internal_url']
|
||||
query_key['class_internal_url'] = diction['class_internal_url']
|
||||
myinternal_url = str(diction['class_internal_url']).strip()
|
||||
query_key['class_internal_url'] = str(diction['class_internal_url']).strip()
|
||||
|
||||
mysession_id = ""
|
||||
if ("session_id" in diction.keys()):
|
||||
if diction['session_id']:
|
||||
mysession_id = diction['session_id']
|
||||
query_key['session_id'] = diction['session_id']
|
||||
mysession_id = str(diction['session_id']).strip()
|
||||
query_key['session_id'] = str(diction['session_id']).strip()
|
||||
|
||||
|
||||
partner_recid = mycommon.get_parnter_recid_from_token(mytoken)
|
||||
|
@ -290,49 +290,49 @@ def UpdateStagiairetoClass(diction):
|
|||
|
||||
if ("nom" in diction.keys()):
|
||||
if diction['nom']:
|
||||
mydata['nom'] = diction['nom']
|
||||
user_nom = diction['nom']
|
||||
mydata['nom'] = str(diction['nom']).strip()
|
||||
user_nom = str(diction['nom']).strip()
|
||||
|
||||
if ("price" in diction.keys()):
|
||||
if diction['price']:
|
||||
mydata['price'] = diction['price']
|
||||
mydata['price'] = str(diction['price']).strip()
|
||||
|
||||
if ("employeur" in diction.keys()):
|
||||
if diction['employeur']:
|
||||
mydata['employeur'] = diction['employeur']
|
||||
mydata['employeur'] = str(diction['employeur']).strip()
|
||||
|
||||
user_prenom = ""
|
||||
if ("prenom" in diction.keys()):
|
||||
if diction['prenom']:
|
||||
mydata['prenom'] = diction['prenom']
|
||||
user_prenom = diction['prenom']
|
||||
mydata['prenom'] = str(diction['prenom']).strip()
|
||||
user_prenom = str(diction['prenom']).strip()
|
||||
|
||||
if ("telephone" in diction.keys()):
|
||||
if diction['telephone']:
|
||||
mydata['telephone'] = diction['telephone']
|
||||
mydata['telephone'] = str(diction['telephone']).strip()
|
||||
|
||||
if ("modefinancement" in diction.keys()):
|
||||
if diction['modefinancement']:
|
||||
mydata['modefinancement'] = diction['modefinancement']
|
||||
mydata['modefinancement'] = str(diction['modefinancement']).strip()
|
||||
|
||||
if ("opco" in diction.keys()):
|
||||
if diction['opco']:
|
||||
mydata['opco'] = diction['opco']
|
||||
mydata['opco'] = str(diction['opco']).strip()
|
||||
|
||||
if ("price" in diction.keys()):
|
||||
if diction['price']:
|
||||
mydata['price'] = diction['price']
|
||||
mydata['price'] = str(diction['price']).strip()
|
||||
|
||||
new_status = ""
|
||||
if ("status" in diction.keys()):
|
||||
if diction['status']:
|
||||
mydata['status'] = diction['status']
|
||||
new_status = diction['status']
|
||||
mydata['status'] = str(diction['status']).strip()
|
||||
new_status = str(diction['status']).strip()
|
||||
|
||||
|
||||
if ("comment" in diction.keys()):
|
||||
if diction['comment']:
|
||||
mydata['comment'] = diction['comment']
|
||||
mydata['comment'] = str(diction['comment']).strip()
|
||||
|
||||
|
||||
"""
|
||||
|
@ -479,9 +479,10 @@ def UpdateStagiairetoClass(diction):
|
|||
new_diction['password'] = secrets.token_urlsafe(6)
|
||||
new_diction['locked'] = "0"
|
||||
|
||||
split_mail_tab = str(myemail).split('@')
|
||||
new_diction['username'] = split_mail_tab[0]
|
||||
#split_mail_tab = str(myemail).split('@')
|
||||
#new_diction['username'] = split_mail_tab[0]
|
||||
|
||||
new_diction['username'] = myemail
|
||||
|
||||
|
||||
local_status, local_message, local_participant_lms_id = mys_lms.Create_MySy_LMS_Apprenant(new_diction)
|
||||
|
@ -1400,7 +1401,7 @@ def AddStagiairetoClass_mass(file=None, Folder=None, diction=None):
|
|||
#print(" Lecture du fichier : "+saved_file)
|
||||
nb_line = 0
|
||||
|
||||
df = pd.read_csv(saved_file, encoding='utf8', on_bad_lines='skip', sep=';')
|
||||
df = pd.read_csv(saved_file, encoding='utf8', on_bad_lines='skip', sep=';', encoding_errors='ignore')
|
||||
|
||||
# Dictionnaire des champs utilisables
|
||||
'''
|
||||
|
@ -2754,6 +2755,10 @@ def Send_LMS_Credentials_to_particpants(diction):
|
|||
email_data['course_owner_email'] = my_partner['email']
|
||||
email_data['partner_recid'] = my_partner['recid']
|
||||
|
||||
#split_mail_tab = str(email).split('@')
|
||||
#email_data['login'] = split_mail_tab[0]
|
||||
|
||||
|
||||
local_status, local_message = email_session.LMS_Credential_Sending_mail(email_data)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
|
|
2589
Log/log_file.log
2589
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -42,6 +42,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']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
|
@ -511,7 +512,7 @@ def Add_Update_SessionFormation_mass(file=None, Folder=None, diction=None):
|
|||
# print(" Lecture du fichier : "+saved_file)
|
||||
nb_line = 0
|
||||
|
||||
df = pd.read_csv(saved_file, encoding='utf8', on_bad_lines='skip', sep=';')
|
||||
df = pd.read_csv(saved_file, encoding='utf8', on_bad_lines='skip', sep=';', encoding_errors='ignore')
|
||||
|
||||
# Dictionnaire des champs utilisables
|
||||
'''
|
||||
|
@ -519,7 +520,7 @@ def Add_Update_SessionFormation_mass(file=None, Folder=None, diction=None):
|
|||
'''
|
||||
field_list = ['date_debut', 'date_fin', 'nb_participant', 'adresse', 'code_postal', 'ville',
|
||||
'session_status', 'date_debut_inscription', 'date_fin_inscription', 'attestation', 'formateur',
|
||||
'code_session', "distanciel", "presentiel", "prix_session", 'contenu_ftion']
|
||||
'code_session', "distanciel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code']
|
||||
|
||||
# Controle du nombre de lignes dans le fichier.
|
||||
total_rows = len(df)
|
||||
|
@ -556,9 +557,26 @@ def Add_Update_SessionFormation_mass(file=None, Folder=None, diction=None):
|
|||
return False, "la session de formation n'existe pas. Impossible d'importer la liste des participants"
|
||||
|
||||
x = range(0, total_rows)
|
||||
ignored_line = ""
|
||||
nb_inserted_line = 0
|
||||
|
||||
for n in x:
|
||||
mydata = {}
|
||||
|
||||
nb_inserted_line = nb_inserted_line + 1
|
||||
# Si une ligne n'a aucune information obligatoire, alors on ignore la ligne
|
||||
if (str(df['code_session'].values[n]) == "nan" or str(df['session_status'].values[n]) == "nan" or
|
||||
str(df['date_debut'].values[n]) == "nan" or str(df['date_fin'].values[n]) == "nan" ):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][
|
||||
3]) + " - La ligne " + str(n + 2) + " a été ignorée")
|
||||
ignored_line = str(n + 2) + " , " + str(ignored_line)
|
||||
|
||||
nb_inserted_line = nb_inserted_line - 1
|
||||
continue
|
||||
|
||||
|
||||
|
||||
mydata['date_debut'] = str(df['date_debut'].values[n]).strip().split(" ")[0]
|
||||
local_status = mycommon.CheckisDate(mydata['date_debut'])
|
||||
if(local_status is False ):
|
||||
|
@ -625,12 +643,18 @@ def Add_Update_SessionFormation_mass(file=None, Folder=None, diction=None):
|
|||
local_code_session = str(df['code_session'].values[n]).strip()
|
||||
mydata['code_session'] = local_code_session
|
||||
|
||||
local_adresse = " "
|
||||
local_adresse = ""
|
||||
if ("adresse" in df.keys()):
|
||||
if (str(df['adresse'].values[n])):
|
||||
local_adresse = str(df['adresse'].values[n]).strip()
|
||||
mydata['adresse'] = local_adresse
|
||||
|
||||
lms_class_code = ""
|
||||
if ("lms_class_code" in df.keys()):
|
||||
if (str(df['lms_class_code'].values[n])):
|
||||
lms_class_code = str(df['lms_class_code'].values[n]).strip()
|
||||
mydata['lms_class_code'] = lms_class_code
|
||||
|
||||
|
||||
|
||||
local_code_postal = ""
|
||||
|
@ -753,7 +777,13 @@ def Add_Update_SessionFormation_mass(file=None, Folder=None, diction=None):
|
|||
|
||||
print(str(total_rows) + " sessions ont été inserées")
|
||||
|
||||
return True, str(total_rows) + " sessions ont été inserées / Mises à jour"
|
||||
message_ignored_line = ""
|
||||
if (ignored_line):
|
||||
message_ignored_line = " ATTENTION - Les lignes [" + str(
|
||||
ignored_line) + "] ont été ignorées. car les toutes informations obligatoires ne sont pas fournies"
|
||||
|
||||
return True, str(nb_inserted_line) + " sessions ont été inserées / Mises à jour. " + str(message_ignored_line)
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
|
|
|
@ -2752,7 +2752,8 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
|||
#print(" Lecture du fichier : "+saved_file)
|
||||
nb_line = 0
|
||||
|
||||
df = pd.read_csv(saved_file, encoding='utf8', on_bad_lines='skip', sep=';')
|
||||
|
||||
df = pd.read_csv(saved_file, encoding='utf8', on_bad_lines='skip', sep=';', encoding_errors='ignore')
|
||||
|
||||
# Dictionnaire des champs utilisables
|
||||
'''
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
,index,mots,occurence,moyenne,id_formation,source_field
|
||||
0,0,qsdqsd,1,1.0,qsdqss,title
|
||||
0,0,gestion,1,0.33,MYSY_Demo_001,title
|
||||
1,1,donne,1,0.33,MYSY_Demo_001,title
|
||||
2,2,base,1,0.33,MYSY_Demo_001,title
|
||||
|
|
|
|
@ -1,2 +1,4 @@
|
|||
mots occurence moyenne id_formation source_field
|
||||
0 qsdqsd 1 1.0 qsdqss title
|
||||
mots occurence moyenne id_formation source_field
|
||||
0 gestion 1 0.33 MYSY_Demo_001 title
|
||||
1 donne 1 0.33 MYSY_Demo_001 title
|
||||
2 base 1 0.33 MYSY_Demo_001 title
|
|
@ -1213,17 +1213,17 @@ def Add_User_To_LMS_Class(diction):
|
|||
my_token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
my_token = diction['token']
|
||||
my_token = str(diction['token']).strip()
|
||||
|
||||
course_code = ""
|
||||
if ("course_code" in diction.keys()):
|
||||
if diction['course_code']:
|
||||
course_code = diction['course_code']
|
||||
course_code = str(diction['course_code']).strip()
|
||||
|
||||
user_lms_id = ""
|
||||
if ("user_lms_id" in diction.keys()):
|
||||
if diction['user_lms_id']:
|
||||
user_lms_id = diction['user_lms_id']
|
||||
user_lms_id = str(diction['user_lms_id']).strip()
|
||||
|
||||
partner_recid = ""
|
||||
# Verification de la validité du token/mail dans le cas des user en mode connecté
|
||||
|
|
Loading…
Reference in New Issue