06/03/2025 - 18h
parent
1a1688df44
commit
62d8938a06
|
@ -1,10 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="04/03/2025 - 21h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="05/03/2025 - 18h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Job_Cron.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.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" />
|
||||
</list>
|
||||
|
@ -77,13 +75,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00393" summary="08/09/2024 - 21h">
|
||||
<created>1725823501100</created>
|
||||
<option name="number" value="00393" />
|
||||
<option name="presentableId" value="LOCAL-00393" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725823501100</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00394" summary="08/09/2024 - 21terth">
|
||||
<created>1725902258192</created>
|
||||
<option name="number" value="00394" />
|
||||
|
@ -420,7 +411,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1741113044249</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="442" />
|
||||
<task id="LOCAL-00442" summary="05/03/2025 - 18h">
|
||||
<created>1741198659032</created>
|
||||
<option name="number" value="00442" />
|
||||
<option name="presentableId" value="LOCAL-00442" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1741198659034</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="443" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -462,7 +460,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="10/12/2024 - 22h" />
|
||||
<MESSAGE value="14/12/2024 - 14h" />
|
||||
<MESSAGE value="24/12/2024 - 22h" />
|
||||
<MESSAGE value="25/12/2024 - 14h" />
|
||||
|
@ -487,6 +484,7 @@
|
|||
<MESSAGE value="18/02/2025 - 21h" />
|
||||
<MESSAGE value="27/02/2025 - 21h" />
|
||||
<MESSAGE value="04/03/2025 - 21h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="04/03/2025 - 21h" />
|
||||
<MESSAGE value="05/03/2025 - 18h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="05/03/2025 - 18h" />
|
||||
</component>
|
||||
</project>
|
1752
Log/log_file.log
1752
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -4752,7 +4752,8 @@ par defaut lorqu'on duplique
|
|||
def Duplicate_List_Session_Formation(diction):
|
||||
try:
|
||||
|
||||
field_list = ['token', 'tab_session_id']
|
||||
field_list = ['token', 'tab_session_id', 'date_debut', 'date_fin', 'session_etape',
|
||||
'formateur_id']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
|
@ -4763,7 +4764,7 @@ def Duplicate_List_Session_Formation(diction):
|
|||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'tab_session_id']
|
||||
field_list_obligatoire = ['token', 'tab_session_id', 'date_debut', 'date_fin']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
|
@ -4794,6 +4795,73 @@ def Duplicate_List_Session_Formation(diction):
|
|||
return False, " La session_id :"+str(session_id)+" n'est pas valide "
|
||||
|
||||
|
||||
# Verifier la validité du formateur si fourni
|
||||
formateur_id = ""
|
||||
if( "formateur_id" in diction.keys() and diction['formateur_id']):
|
||||
formateur_id = diction['formateur_id']
|
||||
is_valide_formateur_count = MYSY_GV.dbname['ressource_humaine'].count_documents({'partner_recid':my_partner['recid'],
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'_id':ObjectId(str(formateur_id))})
|
||||
|
||||
if( is_valide_formateur_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du formateur est invalide ")
|
||||
return False, " L'identifiant du formateur est invalide "
|
||||
|
||||
|
||||
# Verifier la validité de l'etape
|
||||
session_etape = ""
|
||||
if ("session_etape" in diction.keys()):
|
||||
session_etape = str(diction['session_etape'])
|
||||
|
||||
is_valide_etape = MYSY_GV.dbname['base_partner_session_step'].count_documents({'partner_owner_recid':my_partner['recid'],
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'session_step_name':str(session_etape)})
|
||||
if( is_valide_etape != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'étape de la session est invalide ")
|
||||
return False, " L'étape de la session est invalide "
|
||||
|
||||
|
||||
# Verification des date et des cohérences de date
|
||||
local_session_date_debut = ""
|
||||
if ("date_debut" in diction.keys()):
|
||||
local_session_date_debut = str(diction['date_debut'])[0:10]
|
||||
|
||||
local_session_date_fin = ""
|
||||
if ("date_fin" in diction.keys()):
|
||||
local_session_date_fin = str(diction['date_fin'])[0:10]
|
||||
|
||||
# Controle de cohérence sur les dates
|
||||
local_status = mycommon.CheckisDate(str(diction['date_debut'])[0:10])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La date de debut n'est pas au format jj/mm/aaaa ")
|
||||
|
||||
return False, " La date de debut n'est pas au format jj/mm/aaaa "
|
||||
|
||||
local_status = mycommon.CheckisDate(str(diction['date_fin'])[0:10])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La date de fin n'est pas au format jj/mm/aaaa ")
|
||||
|
||||
return False, " La date de fin n'est pas au format jj/mm/aaaa "
|
||||
|
||||
if (datetime.strptime(str(diction['date_debut'])[0:10], '%d/%m/%Y') >= datetime.strptime(
|
||||
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Session de Formation : La date debut " + str(
|
||||
diction['date_debut'])[0:10] +
|
||||
" doit être antérieure à la date de fin " + str(diction['date_fin'])[0:10])
|
||||
|
||||
return False, " Session de Formation : La date debut de formation " + str(diction['date_debut'])[0:10] + \
|
||||
" doit être antérieure à la date de fin de formation " + str(diction['date_fin'])[0:10] + " "
|
||||
|
||||
# Duplicata
|
||||
cpt = 0
|
||||
now = str(datetime.now())
|
||||
|
@ -4818,6 +4886,13 @@ def Duplicate_List_Session_Formation(diction):
|
|||
duplicated_session['code_session'] = str(session_data['code_session'])+"_dup"
|
||||
duplicated_session['date_update'] = now
|
||||
duplicated_session['update_by'] = str(my_partner['_id'])
|
||||
|
||||
duplicated_session['date_debut'] = str(diction['date_debut'])[0:10]
|
||||
duplicated_session['date_fin'] = str(diction['date_fin'])[0:10]
|
||||
duplicated_session['session_etape'] = str(diction['session_etape'])
|
||||
duplicated_session['formateur_id'] = str(formateur_id)
|
||||
|
||||
|
||||
local_retval = MYSY_GV.dbname['session_formation'].insert_one(duplicated_session)
|
||||
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue