parent
de0648a5bd
commit
5d61594ba5
|
|
@ -4,20 +4,16 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="09/01/26 - 20h30">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="30/01/2026 - 18h">
|
||||
<change afterPath="$PROJECT_DIR$/tools_cherif/check_domain_certif_v2.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Activite.py" beforeDir="false" afterPath="$PROJECT_DIR$/Activite.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.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$/jury_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/jury_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ela_user_account.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_user_account.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/session_admission_fi.py" beforeDir="false" afterPath="$PROJECT_DIR$/session_admission_fi.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -460,7 +456,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="525" />
|
||||
<option name="localTasksCounter" value="526" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -502,7 +498,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="12/10/2025 - 17:14 - Elyos V1.2" />
|
||||
<MESSAGE value="14/10/2025 - 23h" />
|
||||
<MESSAGE value="19/10/2025 - 14h" />
|
||||
<MESSAGE value="20/10/2025 - 14h" />
|
||||
|
|
@ -527,6 +522,7 @@
|
|||
<MESSAGE value="02/01/26 - 21h" />
|
||||
<MESSAGE value="04/01/26 - 21h30" />
|
||||
<MESSAGE value="09/01/26 - 20h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="09/01/26 - 20h30" />
|
||||
<MESSAGE value="30/01/2026 - 18h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="30/01/2026 - 18h" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1119,4 +1119,42 @@ PROCES Admission : les status (formation initiale
|
|||
- '' => en cours de traitement
|
||||
|
||||
"""
|
||||
PROCESS_ADMISSION_STATUS = ['-1', '0', '1', '2', '']
|
||||
PROCESS_ADMISSION_STATUS = ['-1', '0', '1', '2', '']
|
||||
|
||||
|
||||
"""
|
||||
Situation de famille
|
||||
"marie", "label": "Marié
|
||||
"pacse", "label": "Pacse",
|
||||
"divorce", "label": "Divorcé",
|
||||
"separe", "label": "Séparé",
|
||||
"celibataire", "label": "Célibataire",
|
||||
"veuf", "label": "Veuf/ve",
|
||||
"autre", "label": "Autre",
|
||||
"", "label": "",
|
||||
"""
|
||||
SITUATION_FAMILLE = ['marie', 'pacse', 'divorce', 'separe', 'celibataire', 'veuf', 'autre', '']
|
||||
|
||||
|
||||
"""
|
||||
Type de pièce d'identité
|
||||
"cni", "label": "CNI",
|
||||
"permis", "label": "Permis Conduire",
|
||||
"passport", "label": "Passport",
|
||||
"autre", "label": "Autre",
|
||||
"", "label": "",
|
||||
"""
|
||||
PICE_IDENTITE_TYPE = ['cni', 'permis', 'passport', 'autre', '']
|
||||
|
||||
|
||||
"""
|
||||
Type de mobilité d'un apprenant
|
||||
"id": "pied", "label": "Pied",
|
||||
"velo", "label": "Vélo",
|
||||
"voiture", "label": "Voiture",
|
||||
"transport", "label": "Transport",
|
||||
"autre", "label": "Autre",
|
||||
"", "label": "",
|
||||
"""
|
||||
|
||||
APPRENANT_MOBILITE = ["pied", "velo", "voiture", "transport", "autre", ""]
|
||||
|
|
@ -82,7 +82,11 @@ def AddStagiairetoClass(diction):
|
|||
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
|
||||
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com','date_naissance',
|
||||
'financeur_rattachement_id', 'tuteur1_civilite', 'tuteur2_civilite', 'quotation_id',
|
||||
'facture_client_rattachement_id', 'tab_ue_ids','memo', 'comment'
|
||||
'facture_client_rattachement_id', 'tab_ue_ids','memo', 'comment',
|
||||
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu',
|
||||
'naissance_departement',
|
||||
'naissance_pays', 'num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite',
|
||||
'telephone_bis',
|
||||
]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
|
@ -188,6 +192,122 @@ def AddStagiairetoClass(diction):
|
|||
mydata['comment'] = comment
|
||||
|
||||
|
||||
if ("is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_handicap' est invalide ")
|
||||
return False, " Le champ 'is_handicap' est invalide "
|
||||
|
||||
is_handicap = ""
|
||||
if ("is_handicap" in diction.keys()):
|
||||
if diction['is_handicap']:
|
||||
is_handicap = str(diction['is_handicap']).strip()
|
||||
mydata['is_handicap'] = is_handicap
|
||||
|
||||
|
||||
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_droit_image' est invalide ")
|
||||
return False, " Le champ 'is_droit_image' est invalide "
|
||||
|
||||
is_droit_image = ""
|
||||
if ("is_droit_image" in diction.keys()):
|
||||
if diction['is_droit_image']:
|
||||
is_droit_image = str(diction['is_droit_image']).strip()
|
||||
mydata['is_droit_image'] = is_droit_image
|
||||
|
||||
|
||||
if ("situation_famille" in diction.keys() and str(diction['situation_famille']) not in MYSY_GV.SITUATION_FAMILLE):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'situation_famille' est invalide ")
|
||||
return False, " Le champ 'situation_famille' est invalide "
|
||||
|
||||
situation_famille = ""
|
||||
if ("situation_famille" in diction.keys()):
|
||||
if diction['situation_famille']:
|
||||
situation_famille = str(diction['situation_famille']).strip()
|
||||
mydata['situation_famille'] = situation_famille
|
||||
|
||||
|
||||
if ("identite_type" in diction.keys() and str(diction['identite_type']) not in MYSY_GV.PICE_IDENTITE_TYPE):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'identite_type' est invalide ")
|
||||
return False, " Le champ 'identite_type' est invalide "
|
||||
|
||||
identite_type = ""
|
||||
if ("identite_type" in diction.keys()):
|
||||
if diction['identite_type']:
|
||||
identite_type = str(diction['identite_type']).strip()
|
||||
mydata['identite_type'] = identite_type
|
||||
|
||||
|
||||
if ("type_mobilite" in diction.keys() and str(diction['type_mobilite']) not in MYSY_GV.APPRENANT_MOBILITE):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'type_mobilite' est invalide ")
|
||||
return False, " Le champ 'type_mobilite' est invalide "
|
||||
|
||||
type_mobilite = ""
|
||||
if ("type_mobilite" in diction.keys()):
|
||||
if diction['type_mobilite']:
|
||||
type_mobilite = str(diction['type_mobilite']).strip()
|
||||
mydata['type_mobilite'] = type_mobilite
|
||||
|
||||
|
||||
|
||||
nationalite = ""
|
||||
if ("nationalite" in diction.keys()):
|
||||
if diction['nationalite']:
|
||||
nationalite = str(diction['nationalite']).strip()
|
||||
mydata['nationalite'] = nationalite
|
||||
|
||||
naissance_lieu = ""
|
||||
if ("naissance_lieu" in diction.keys()):
|
||||
if diction['naissance_lieu']:
|
||||
naissance_lieu = str(diction['naissance_lieu']).strip()
|
||||
mydata['naissance_lieu'] = naissance_lieu
|
||||
|
||||
naissance_departement = ""
|
||||
if ("naissance_departement" in diction.keys()):
|
||||
if diction['naissance_departement']:
|
||||
naissance_departement = str(diction['naissance_departement']).strip()
|
||||
mydata['naissance_departement'] = naissance_departement
|
||||
|
||||
naissance_pays = ""
|
||||
if ("naissance_pays" in diction.keys()):
|
||||
if diction['naissance_pays']:
|
||||
naissance_pays = str(diction['naissance_pays']).strip()
|
||||
mydata['naissance_pays'] = naissance_pays
|
||||
|
||||
num_secu = ""
|
||||
if ("num_secu" in diction.keys()):
|
||||
if diction['num_secu']:
|
||||
num_secu = str(diction['num_secu']).strip()
|
||||
mydata['num_secu'] = num_secu
|
||||
|
||||
piece_identite_num = ""
|
||||
if ("piece_identite_num" in diction.keys()):
|
||||
if diction['piece_identite_num']:
|
||||
piece_identite_num = str(diction['piece_identite_num']).strip()
|
||||
mydata['piece_identite_num'] = piece_identite_num
|
||||
|
||||
telephone_bis = ""
|
||||
if ("telephone_bis" in diction.keys()):
|
||||
if diction['telephone_bis']:
|
||||
telephone_bis = str(diction['telephone_bis']).strip()
|
||||
mydata['telephone_bis'] = telephone_bis
|
||||
|
||||
|
||||
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_rgpd' est invalide ")
|
||||
return False, " Le champ 'is_rgpd' est invalide "
|
||||
|
||||
is_rgpd = ""
|
||||
if ("is_rgpd" in diction.keys()):
|
||||
if diction['is_rgpd']:
|
||||
is_rgpd = str(diction['is_rgpd']).strip()
|
||||
mydata['is_rgpd'] = is_rgpd
|
||||
|
||||
"""
|
||||
Verififier l'existance et la valididé de la session
|
||||
|
|
@ -1752,7 +1872,13 @@ def UpdateStagiairetoClass(diction):
|
|||
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
|
||||
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
|
||||
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'type_apprenant', 'civilite',
|
||||
'date_naissance', 'financeur_rattachement_id', 'facture_client_rattachement_id', 'memo'
|
||||
'date_naissance', 'financeur_rattachement_id', 'facture_client_rattachement_id', 'memo',
|
||||
|
||||
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu',
|
||||
'naissance_departement',
|
||||
'naissance_pays', 'num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite',
|
||||
'telephone_bis',
|
||||
|
||||
]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
|
@ -2040,6 +2166,99 @@ def UpdateStagiairetoClass(diction):
|
|||
return False, " Le financeur de rattachement est invalide "
|
||||
|
||||
|
||||
|
||||
|
||||
if ("is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_handicap' est invalide ")
|
||||
return False, " Le champ 'is_handicap' est invalide "
|
||||
|
||||
if ("is_handicap" in diction.keys()):
|
||||
mydata['is_handicap'] = str(diction['is_handicap']).strip()
|
||||
|
||||
|
||||
|
||||
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_droit_image' est invalide ")
|
||||
return False, " Le champ 'is_droit_image' est invalide "
|
||||
|
||||
|
||||
if ("is_droit_image" in diction.keys()):
|
||||
mydata['is_droit_image'] = str(diction['is_droit_image']).strip()
|
||||
|
||||
|
||||
if ("situation_famille" in diction.keys() and str(diction['situation_famille']) not in MYSY_GV.SITUATION_FAMILLE):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'situation_famille' est invalide ")
|
||||
return False, " Le champ 'situation_famille' est invalide "
|
||||
|
||||
|
||||
if ("situation_famille" in diction.keys()):
|
||||
mydata['situation_famille'] = str(diction['situation_famille']).strip()
|
||||
|
||||
|
||||
if ("identite_type" in diction.keys() and str(diction['identite_type']) not in MYSY_GV.PICE_IDENTITE_TYPE):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'identite_type' est invalide ")
|
||||
return False, " Le champ 'identite_type' est invalide "
|
||||
|
||||
|
||||
if ("identite_type" in diction.keys()):
|
||||
mydata['identite_type'] = str(diction['identite_type']).strip()
|
||||
|
||||
|
||||
if ("type_mobilite" in diction.keys() and str(diction['type_mobilite']) not in MYSY_GV.APPRENANT_MOBILITE):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'type_mobilite' est invalide ")
|
||||
return False, " Le champ 'type_mobilite' est invalide "
|
||||
|
||||
|
||||
if ("type_mobilite" in diction.keys()):
|
||||
mydata['type_mobilite'] = str(diction['type_mobilite']).strip()
|
||||
|
||||
|
||||
if ("nationalite" in diction.keys()):
|
||||
mydata['nationalite'] = str(diction['nationalite']).strip()
|
||||
|
||||
|
||||
if ("naissance_lieu" in diction.keys()):
|
||||
mydata['naissance_lieu'] = str(diction['naissance_lieu']).strip()
|
||||
|
||||
naissance_departement = ""
|
||||
if ("naissance_departement" in diction.keys()):
|
||||
mydata['naissance_departement'] = str(diction['naissance_departement']).strip()
|
||||
|
||||
|
||||
if ("naissance_pays" in diction.keys()):
|
||||
mydata['naissance_pays'] = str(diction['naissance_pays']).strip()
|
||||
|
||||
|
||||
if ("num_secu" in diction.keys()):
|
||||
mydata['num_secu'] = str(diction['num_secu']).strip()
|
||||
|
||||
|
||||
if ("piece_identite_num" in diction.keys()):
|
||||
mydata['piece_identite_num'] = str(diction['piece_identite_num']).strip()
|
||||
|
||||
|
||||
if ("telephone_bis" in diction.keys()):
|
||||
mydata['telephone_bis'] = str(diction['telephone_bis']).strip()
|
||||
|
||||
|
||||
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1', '']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_rgpd' est invalide ")
|
||||
return False, " Le champ 'is_rgpd' est invalide "
|
||||
|
||||
if ("is_rgpd" in diction.keys()):
|
||||
mydata['is_rgpd'] = str(diction['is_rgpd']).strip()
|
||||
|
||||
|
||||
|
||||
|
||||
# ici recup des infos de la session
|
||||
local_query = {'_id': ObjectId(str(mysession_id)), 'valide': '1'}
|
||||
print("### local_query = " + str(local_query))
|
||||
|
|
@ -9738,6 +9957,80 @@ def GetAttendeeDetail_perSession_from_line_id(diction):
|
|||
my_retrun_dict['status'] = local_status
|
||||
|
||||
|
||||
if ("is_droit_image" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['is_droit_image'] = local_Insc_retval['is_droit_image']
|
||||
else:
|
||||
my_retrun_dict['is_droit_image'] = "0"
|
||||
|
||||
|
||||
if ("is_handicap" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['is_handicap'] = local_Insc_retval['is_handicap']
|
||||
else:
|
||||
my_retrun_dict['is_handicap'] = "0"
|
||||
|
||||
if ("is_rgpd" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['is_rgpd'] = local_Insc_retval['is_rgpd']
|
||||
else:
|
||||
my_retrun_dict['is_rgpd'] = "0"
|
||||
|
||||
if ("naissance_departement" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_departement'] = local_Insc_retval['naissance_departement']
|
||||
else:
|
||||
my_retrun_dict['naissance_departement'] = ""
|
||||
|
||||
|
||||
if ("naissance_departement" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_departement'] = local_Insc_retval['naissance_departement']
|
||||
else:
|
||||
my_retrun_dict['naissance_departement'] = ""
|
||||
|
||||
|
||||
if ("naissance_lieu" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_lieu'] = local_Insc_retval['naissance_lieu']
|
||||
else:
|
||||
my_retrun_dict['naissance_lieu'] = ""
|
||||
|
||||
|
||||
if ("naissance_pays" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_pays'] = local_Insc_retval['naissance_pays']
|
||||
else:
|
||||
my_retrun_dict['naissance_pays'] = ""
|
||||
|
||||
if ("nationalite" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['nationalite'] = local_Insc_retval['nationalite']
|
||||
else:
|
||||
my_retrun_dict['nationalite'] = ""
|
||||
|
||||
|
||||
if ("num_secu" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['num_secu'] = local_Insc_retval['num_secu']
|
||||
else:
|
||||
my_retrun_dict['num_secu'] = ""
|
||||
|
||||
if ("piece_identite_num" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['piece_identite_num'] = local_Insc_retval['piece_identite_num']
|
||||
else:
|
||||
my_retrun_dict['piece_identite_num'] = ""
|
||||
|
||||
if ("situation_famille" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['situation_famille'] = local_Insc_retval['situation_famille']
|
||||
else:
|
||||
my_retrun_dict['situation_famille'] = ""
|
||||
|
||||
if ("telephone_bis" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['telephone_bis'] = local_Insc_retval['telephone_bis']
|
||||
else:
|
||||
my_retrun_dict['telephone_bis'] = ""
|
||||
|
||||
|
||||
if ("type_mobilite" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['type_mobilite'] = local_Insc_retval['type_mobilite']
|
||||
else:
|
||||
my_retrun_dict['type_mobilite'] = ""
|
||||
|
||||
|
||||
|
||||
|
||||
if ("archive" not in local_Insc_retval.keys()):
|
||||
my_retrun_dict['archive'] = "0"
|
||||
|
||||
|
|
|
|||
8135
Log/log_file.log
8135
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
|
@ -1821,8 +1821,8 @@ def InitUserPasswd(diction):
|
|||
#print(" new token to insert = "+str(new_token))
|
||||
ret_val_tmp = coll_name_token.insert_one(new_token)
|
||||
if (ret_val_tmp is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de créer le nouveau toek")
|
||||
return True, "La demande de reinitiation à été prise en compte"
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de créer le nouveau token")
|
||||
return True, "La demande de réinitialisation a été prise en compte."
|
||||
|
||||
# Account type 1 is for normal customers
|
||||
account_type = 1
|
||||
|
|
@ -1830,7 +1830,7 @@ def InitUserPasswd(diction):
|
|||
# envoi de l'email
|
||||
email_mgt.send_user_init_pwd_mail(mynewtoken, retVal[0]['email'], account_type)
|
||||
|
||||
return True, "La demande de reinitiation à été prise en compte"
|
||||
return True, "La demande de réinitialisation a été prise en compte."
|
||||
|
||||
elif( account_type == "partner"):
|
||||
'''
|
||||
|
|
@ -1843,8 +1843,8 @@ def InitUserPasswd(diction):
|
|||
|
||||
tmp = coll_name.count_documents(myquery)
|
||||
if (tmp <= 0):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Aucun resultat trouvé pour le compte pro " + str(myquery))
|
||||
return True, "La demande de reinitiation à été prise en compte"
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Aucun résultat trouvé pour le compte pro " + str(myquery))
|
||||
return True, "La demande de réinitialisation a été prise en compte."
|
||||
|
||||
retVal = coll_name.find(myquery, {"_id": 0, "valide": 0,})
|
||||
|
||||
|
|
@ -1876,8 +1876,8 @@ def InitUserPasswd(diction):
|
|||
if ("_id" not in ret_val.keys()):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " : Impossible de reinitialiser le mot de passe")
|
||||
return False, "Impossible de reinitialiser le mot de passe"
|
||||
3]) + " : Impossible de réinitialiser le mot de passe")
|
||||
return False, "Impossible de réinitialiser le mot de passe"
|
||||
|
||||
"""
|
||||
Apres la mise à jour du partner, on insert l'objet qui signifie qu'il y a une
|
||||
|
|
@ -1898,7 +1898,7 @@ def InitUserPasswd(diction):
|
|||
account_type = 2
|
||||
email_mgt.send_user_init_pwd_mail(mynewtoken, retVal[0]['email'],account_type )
|
||||
|
||||
return True, "La demande de réinitialisation à été prise en compte"
|
||||
return True, "La demande de réinitialisation a été prise en compte."
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -1506,7 +1506,7 @@ def send_user_init_pwd_mail(token, account_mail, type_account):
|
|||
my_url = "https://demo.mysy-training.com/ResetUserPwd/" + str(token) + "/" + str(type_account)
|
||||
|
||||
elif (MYSY_GV.MYSY_ENV == "XCELIA_DEM"):
|
||||
my_url = "https://demoapi.xceliahub.com/ResetUserPwd/" + str(token) + "/" + str(type_account)
|
||||
my_url = "https://demo.xceliahub.com/ResetUserPwd/" + str(token) + "/" + str(type_account)
|
||||
|
||||
"""send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(template_id=19, params={"mysyurl": my_url,
|
||||
"user_name": str(account_mail),
|
||||
|
|
|
|||
20
main.py
20
main.py
|
|
@ -38,6 +38,9 @@ import email_inscription_mgt as emails_support
|
|||
import opco as opco
|
||||
import Attestation_Certificat as Att_Cert
|
||||
import tools_cherif.tools_cherif as tools_cherif
|
||||
|
||||
import tools_cherif.check_domain_certif_v2 as check_domain_certif_v2
|
||||
|
||||
import business_prices as business_prices
|
||||
import lms_chamilo.mysy_lms as mysy_lms
|
||||
import code_promo_mgt as code_promo_mgt
|
||||
|
|
@ -13190,6 +13193,11 @@ def Conformite_Article_Blog_Dev():
|
|||
localStatus, message= tools_cherif.Conformite_Article_Blog_Dev()
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@app.route('/myclass/api/Conformite_Article_Blog_Recette/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Conformite_Article_Blog_Recette():
|
||||
|
|
@ -13222,6 +13230,18 @@ def Conformite_Article_Blog_Prod():
|
|||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API pour tester validité des domaines et certificat - sera utilisé pour le monitoring
|
||||
"""
|
||||
@app.route('/myclass/api/check_domain_certificate/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def check_domain_certificate():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### check_domain_certificate : payload = ",payload)
|
||||
localStatus, message= check_domain_certif_v2.check_domain_certificate()
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
"""
|
||||
API pour créer ou mettre à jour la configuration d'envoi automatique d'un type de document
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -3401,6 +3401,80 @@ def GetAttendeeDetail_perSession(diction):
|
|||
else:
|
||||
my_retrun_dict['type_apprenant'] = ""
|
||||
|
||||
|
||||
if ("is_droit_image" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['is_droit_image'] = local_Insc_retval['is_droit_image']
|
||||
else:
|
||||
my_retrun_dict['is_droit_image'] = "0"
|
||||
|
||||
|
||||
if ("is_handicap" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['is_handicap'] = local_Insc_retval['is_handicap']
|
||||
else:
|
||||
my_retrun_dict['is_handicap'] = "0"
|
||||
|
||||
if ("is_rgpd" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['is_rgpd'] = local_Insc_retval['is_rgpd']
|
||||
else:
|
||||
my_retrun_dict['is_rgpd'] = "0"
|
||||
|
||||
if ("naissance_departement" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_departement'] = local_Insc_retval['naissance_departement']
|
||||
else:
|
||||
my_retrun_dict['naissance_departement'] = ""
|
||||
|
||||
|
||||
if ("naissance_departement" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_departement'] = local_Insc_retval['naissance_departement']
|
||||
else:
|
||||
my_retrun_dict['naissance_departement'] = ""
|
||||
|
||||
|
||||
if ("naissance_lieu" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_lieu'] = local_Insc_retval['naissance_lieu']
|
||||
else:
|
||||
my_retrun_dict['naissance_lieu'] = ""
|
||||
|
||||
|
||||
if ("naissance_pays" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['naissance_pays'] = local_Insc_retval['naissance_pays']
|
||||
else:
|
||||
my_retrun_dict['naissance_pays'] = ""
|
||||
|
||||
if ("nationalite" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['nationalite'] = local_Insc_retval['nationalite']
|
||||
else:
|
||||
my_retrun_dict['nationalite'] = ""
|
||||
|
||||
|
||||
if ("num_secu" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['num_secu'] = local_Insc_retval['num_secu']
|
||||
else:
|
||||
my_retrun_dict['num_secu'] = ""
|
||||
|
||||
if ("piece_identite_num" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['piece_identite_num'] = local_Insc_retval['piece_identite_num']
|
||||
else:
|
||||
my_retrun_dict['piece_identite_num'] = ""
|
||||
|
||||
if ("situation_famille" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['situation_famille'] = local_Insc_retval['situation_famille']
|
||||
else:
|
||||
my_retrun_dict['situation_famille'] = ""
|
||||
|
||||
if ("telephone_bis" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['telephone_bis'] = local_Insc_retval['telephone_bis']
|
||||
else:
|
||||
my_retrun_dict['telephone_bis'] = ""
|
||||
|
||||
|
||||
if ("type_mobilite" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['type_mobilite'] = local_Insc_retval['type_mobilite']
|
||||
else:
|
||||
my_retrun_dict['type_mobilite'] = ""
|
||||
|
||||
|
||||
"""
|
||||
# Tuteurs
|
||||
if ("tuteur1_nom" in local_Insc_retval.keys()):
|
||||
my_retrun_dict['tuteur1_nom'] = local_Insc_retval['tuteur1_nom']
|
||||
|
|
@ -3491,7 +3565,8 @@ def GetAttendeeDetail_perSession(diction):
|
|||
my_retrun_dict['tuteur2_include_com'] = local_Insc_retval['tuteur2_include_com']
|
||||
else:
|
||||
my_retrun_dict['tuteur2_include_com'] = ""
|
||||
|
||||
|
||||
"""
|
||||
|
||||
if ("certification_send_date" in local_Insc_retval.keys()):
|
||||
if (str(local_Insc_retval['certification_send_date'])):
|
||||
|
|
|
|||
|
|
@ -0,0 +1,171 @@
|
|||
# This is a sample Python script.
|
||||
import smtplib
|
||||
from datetime import datetime
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
import requests
|
||||
import csv
|
||||
import whois
|
||||
import ssl
|
||||
import inspect
|
||||
import sys, os
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
import prj_common as mycommon
|
||||
|
||||
O365_SMTP_COUNT_password = 'Sod78!526+'
|
||||
O365_SMTP_COUNT_smtpsrv = "smtp.office365.com"
|
||||
O365_SMTP_COUNT_user = "communication@mysytraining.fr"
|
||||
O365_SMTP_COUNT_From_User = "communication@mysytraining.fr"
|
||||
O365_SMTP_COUNT_port = 587
|
||||
|
||||
# Press Maj+F10 to execute it or replace it with your code.
|
||||
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
|
||||
|
||||
domains = ['mysy-hosting.com', 'mysy-training.fr', 'lms-mysy-training.com', 'mysytraining.fr', 'iexercice.com', 'iexercice.org', 'demomysy-hosting.online', 'devmysy-hosting.online', 'mysy-hosting.online', 'demolmsmysy-hosting.com',
|
||||
'mysytraining.com', 'educetera.org', 'bazarcorner.com', 'misitraining.com', 'misi-training.com', 'mysy-training.com']
|
||||
|
||||
|
||||
|
||||
def print_hi(name):
|
||||
# Use a breakpoint in the code line below to debug your script.
|
||||
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction monitore un siteweb.
|
||||
si Ko, alors il envoie un email
|
||||
à cherif.
|
||||
c'est une version degradée
|
||||
"""
|
||||
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
import OpenSSL
|
||||
import ssl
|
||||
|
||||
|
||||
def check_domain_certificate():
|
||||
try:
|
||||
|
||||
# check the expiry date and SSL status of each domain
|
||||
results = []
|
||||
certif_expiration = []
|
||||
domaine_expiration = []
|
||||
|
||||
send_email_notif = ""
|
||||
|
||||
for domain in domains:
|
||||
expiry_date = ''
|
||||
ssl_status = ''
|
||||
try:
|
||||
local_domain_node = {}
|
||||
local_domain_node['domain'] = domain
|
||||
local_domain_node['expiration_date'] = "KO"
|
||||
local_domain_node['comment'] = "N/A"
|
||||
|
||||
domaine_expiration.append(local_domain_node)
|
||||
|
||||
# get the expiry date using the whois library
|
||||
expiry_date = whois.whois(domain).expiration_date.strftime('%Y-%m-%d')
|
||||
|
||||
local_domain_node['expiration_date'] = expiry_date
|
||||
|
||||
age01 = datetime.strptime(expiry_date, '%Y-%m-%d').date() - datetime.today().date()
|
||||
|
||||
local_domain_node['comment'] = "DOMAINE Expire dans " + str(age01.days) + " jours"
|
||||
if( float(age01.days) <= 10 ):
|
||||
send_email_notif = "1"
|
||||
|
||||
|
||||
except Exception as e:
|
||||
send_email_notif = "1"
|
||||
print(" Domain ", domain, " expiratopn = KOOO")
|
||||
print(f"NOT OK: {str(e)}")
|
||||
|
||||
|
||||
try:
|
||||
|
||||
local_ssl_node = {}
|
||||
local_ssl_node['domain'] = domain
|
||||
local_ssl_node['expiration_date'] = "KO"
|
||||
local_ssl_node['comment'] = "N/A"
|
||||
|
||||
certif_expiration.append(local_ssl_node)
|
||||
|
||||
cert = ssl.get_server_certificate((domain, 443))
|
||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert)
|
||||
bytes = x509.get_notAfter()
|
||||
|
||||
|
||||
timestamp = bytes.decode('utf-8')
|
||||
if (timestamp):
|
||||
expiration_date = datetime.strptime(timestamp, '%Y%m%d%H%M%S%z').date().isoformat()
|
||||
#print("Pour le domain : ", domain, " ==> ", datetime.strptime(timestamp, '%Y%m%d%H%M%S%z').date().isoformat())
|
||||
local_ssl_node['expiration_date'] = expiration_date
|
||||
age = datetime.strptime(timestamp, '%Y%m%d%H%M%S%z').date() - datetime.today().date()
|
||||
local_ssl_node['comment'] = "CERTIFICAT Expire dans "+str(age.days)+" jours"
|
||||
|
||||
if (float(age.days) <= 10):
|
||||
send_email_notif = "1"
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(" CERTIF Domain ", domain, " expiratopn = KOOO")
|
||||
print(f"NOT OK: {str(e)}")
|
||||
send_email_notif = "1"
|
||||
|
||||
|
||||
|
||||
|
||||
if (send_email_notif == "1"):
|
||||
""" Envoyer un email """
|
||||
html = '''
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<div> Un de vos domaines est KO <br/> </div>
|
||||
<div> {domaine_expiration} </div>
|
||||
<br/> <br/>
|
||||
<div> Un de vos certificats est KO <br/> </div>
|
||||
<div> {certif_expiration} </div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>'''.format(domaine_expiration=str(domaine_expiration), certif_expiration=str(certif_expiration),)
|
||||
|
||||
html_mime = MIMEText(html, 'html')
|
||||
msg = MIMEMultipart("alternative")
|
||||
smtpserver = smtplib.SMTP(O365_SMTP_COUNT_smtpsrv, O365_SMTP_COUNT_port)
|
||||
msg.attach(html_mime)
|
||||
msg['From'] = O365_SMTP_COUNT_From_User
|
||||
msg['Bcc'] = 'contact@mysy-training.com'
|
||||
msg['Subject'] = " IMPORTANT : Un domaine ou un certificat va bientot expirer ou est KO"
|
||||
msg['To'] = "cherif.balde@yahoo.fr, cbalde@mysy-training.com"
|
||||
|
||||
smtpserver.ehlo()
|
||||
smtpserver.starttls()
|
||||
smtpserver.login(O365_SMTP_COUNT_user, O365_SMTP_COUNT_password)
|
||||
val = smtpserver.send_message(msg)
|
||||
smtpserver.close()
|
||||
print(" Email envoyé " + str(val))
|
||||
|
||||
return send_email_notif, " Site KOOO"
|
||||
|
||||
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 contrôler l'état des sites web"
|
||||
|
||||
|
||||
|
||||
# Press the green button in the gutter to run the script.
|
||||
if __name__ == '__main__':
|
||||
check_domain_certificate()
|
||||
print_hi('PyCharm')
|
||||
|
||||
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
|
||||
Loading…
Reference in New Issue