18/10/2023 - 22h45
parent
8c4bf436d4
commit
c09aa9fc40
|
@ -1,13 +1,10 @@
|
|||
<?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="17/10/2023 - 22h40">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="17/10/2023 - 22h45">
|
||||
<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$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -77,13 +74,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00081" summary="23/08/23 - 20h">
|
||||
<created>1692815833458</created>
|
||||
<option name="number" value="00081" />
|
||||
<option name="presentableId" value="LOCAL-00081" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1692815833458</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00082" summary="24/08/23 - 12h">
|
||||
<created>1692874458640</created>
|
||||
<option name="number" value="00082" />
|
||||
|
@ -420,7 +410,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1697571685666</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="130" />
|
||||
<task id="LOCAL-00130" summary="17/10/2023 - 22h45">
|
||||
<created>1697626088499</created>
|
||||
<option name="number" value="00130" />
|
||||
<option name="presentableId" value="LOCAL-00130" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1697626088499</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="131" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -435,7 +432,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="13/09/2023 - 18h" />
|
||||
<MESSAGE value="14/09/2023 - 21h" />
|
||||
<MESSAGE value="15/09/2023 - 12h" />
|
||||
<MESSAGE value="15/09/2023 - 18h" />
|
||||
|
@ -460,6 +456,7 @@
|
|||
<MESSAGE value="07/10/2023 - 22h40" />
|
||||
<MESSAGE value="08/10/2023 - 22h40" />
|
||||
<MESSAGE value="17/10/2023 - 22h40" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="17/10/2023 - 22h40" />
|
||||
<MESSAGE value="17/10/2023 - 22h45" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="17/10/2023 - 22h45" />
|
||||
</component>
|
||||
</project>
|
2107
Log/log_file.log
2107
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -239,61 +239,62 @@ def Add_Update_SessionFormation(diction):
|
|||
" est postérieure à la date de fin de formation " + str(diction['date_fin'])[0:10] + " "
|
||||
|
||||
# Verification de la cohérence des dates d'inscription si on a bien une date debut et une date de fin
|
||||
if (str(diction['date_debut_inscription']).strip() != "" and str(
|
||||
diction['date_fin_inscription']).strip() != ""):
|
||||
local_status = mycommon.CheckisDate(str(diction['date_debut_inscription'])[0:10])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Formation : " + str(
|
||||
code_session) + " : Impossible de créer/mettre à jour la session de formation. La date_debut_inscription n'est pas au format jj/mm/aaaa ")
|
||||
if( "date_debut_inscription" in diction.keys() and "date_fin_inscription" in diction.keys() ):
|
||||
if (str(diction['date_debut_inscription']).strip() != "" and str(
|
||||
diction['date_fin_inscription']).strip() != ""):
|
||||
local_status = mycommon.CheckisDate(str(diction['date_debut_inscription'])[0:10])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Formation : " + str(
|
||||
code_session) + " : Impossible de créer/mettre à jour la session de formation. La date_debut_inscription n'est pas au format jj/mm/aaaa ")
|
||||
|
||||
return False, " -Formation : " + str(
|
||||
code_session) + " : La date de début d'inscription n'est pas au format jj/mm/aaaa "
|
||||
return False, " -Formation : " + str(
|
||||
code_session) + " : La date de début d'inscription n'est pas au format jj/mm/aaaa "
|
||||
|
||||
local_status = mycommon.CheckisDate(str(diction['date_fin_inscription'])[0:10])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " -Formation : " + str(
|
||||
code_session) + " : La date de fin d'inscription n'est pas au format jj/mm/aaaa ")
|
||||
local_status = mycommon.CheckisDate(str(diction['date_fin_inscription'])[0:10])
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " -Formation : " + str(
|
||||
code_session) + " : La date de fin d'inscription n'est pas au format jj/mm/aaaa ")
|
||||
|
||||
return False, " - Formation : " + str(
|
||||
code_session) + " :La date de fin d'inscription n'est pas au format jj/mm/aaaa "
|
||||
return False, " - Formation : " + str(
|
||||
code_session) + " :La date de fin d'inscription n'est pas au format jj/mm/aaaa "
|
||||
|
||||
|
||||
if (datetime.strptime(str(diction['date_debut_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
|
||||
str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Formation : "+str(code_session)+" : La date date_debut_inscription " + str(
|
||||
diction['date_debut_inscription']) +
|
||||
" est postérieure à la date de date_fin_inscription " + str(diction['date_fin_inscription']) )
|
||||
if (datetime.strptime(str(diction['date_debut_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
|
||||
str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Formation : "+str(code_session)+" : La date date_debut_inscription " + str(
|
||||
diction['date_debut_inscription']) +
|
||||
" est postérieure à la date de date_fin_inscription " + str(diction['date_fin_inscription']) )
|
||||
|
||||
return False, " Formation : "+str(code_session)+" : La date_debut_inscription " + str(diction['date_debut_inscription']) + \
|
||||
" est postérieure à la date_fin_inscription " + str(diction['date_fin_inscription']) + " "
|
||||
return False, " Formation : "+str(code_session)+" : La date_debut_inscription " + str(diction['date_debut_inscription']) + \
|
||||
" est postérieure à la date_fin_inscription " + str(diction['date_fin_inscription']) + " "
|
||||
|
||||
|
||||
|
||||
# Verification : Date de debut inscription n'est pas > date de fin de formation
|
||||
if (datetime.strptime(str(diction['date_debut_inscription'])[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 de debut d'inscription " + str( diction['date_debut_inscription'])+ " est postérieure à la date de fin de formation " + str(diction['date_fin']))
|
||||
# Verification : Date de debut inscription n'est pas > date de fin de formation
|
||||
if (datetime.strptime(str(diction['date_debut_inscription'])[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 de debut d'inscription " + str( diction['date_debut_inscription'])+ " est postérieure à la date de fin de formation " + str(diction['date_fin']))
|
||||
|
||||
return False, " Session de Formation : La date de debut d'inscription " + str( diction['date_debut_inscription'])[0:10] + " est postérieure à la date de fin de formation " + str(diction['date_fin'])[0:10]+" "
|
||||
return False, " Session de Formation : La date de debut d'inscription " + str( diction['date_debut_inscription'])[0:10] + " est postérieure à la date de fin de formation " + str(diction['date_fin'])[0:10]+" "
|
||||
|
||||
# Verification : Date de fin inscription n'est pas > date de fin de formation
|
||||
if (datetime.strptime(str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
|
||||
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " -Formation : "+str(code_session)+" : La date de fin d'inscription " + str(
|
||||
# Verification : Date de fin inscription n'est pas > date de fin de formation
|
||||
if (datetime.strptime(str(diction['date_fin_inscription'])[0:10], '%d/%m/%Y') > datetime.strptime(
|
||||
str(diction['date_fin'])[0:10], '%d/%m/%Y')):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " -Formation : "+str(code_session)+" : La date de fin d'inscription " + str(
|
||||
diction['date_fin_inscription'])[0:10] + " est postérieure à la date de fin de la formation " + str(
|
||||
diction['date_fin'])[0:10])
|
||||
|
||||
return False, " Formation : "+str(code_session)+" : La date de fin d'inscription " + str(
|
||||
diction['date_fin_inscription'])[0:10] + " est postérieure à la date de fin de la formation " + str(
|
||||
diction['date_fin'])[0:10])
|
||||
|
||||
return False, " Formation : "+str(code_session)+" : La date de fin d'inscription " + str(
|
||||
diction['date_fin_inscription'])[0:10] + " est postérieure à la date de fin de la formation " + str(
|
||||
diction['date_fin'])[0:10] + " "
|
||||
diction['date_fin'])[0:10] + " "
|
||||
|
||||
|
||||
"""
|
||||
|
@ -3191,17 +3192,9 @@ def Is_Corresponding_SessionFormation(diction):
|
|||
|
||||
class_internal_url = str(myclass_data['internal_url'])
|
||||
|
||||
session_id = ""
|
||||
if ("session_id" in diction.keys()):
|
||||
if diction['session_id']:
|
||||
session_id = diction['session_id']
|
||||
|
||||
if(str(session_id).strip() == ""):
|
||||
return True, []
|
||||
|
||||
coll_session = MYSY_GV.dbname['session_formation']
|
||||
|
||||
myquery = [{'$match':{'_id':ObjectId(str(session_id)), 'class_internal_url':class_internal_url, 'partner_owner_recid':str(partner_recid)}},
|
||||
myquery = [{'$match':{ 'class_internal_url':class_internal_url, 'partner_owner_recid':str(partner_recid)}},
|
||||
{'$lookup':
|
||||
{
|
||||
'from': 'myclass',
|
||||
|
@ -3218,7 +3211,7 @@ def Is_Corresponding_SessionFormation(diction):
|
|||
|
||||
nb_val = 0
|
||||
for retval in coll_session.aggregate(myquery):
|
||||
print(" ##### Is_Corresponding_SessionFormation retval a controle = " + str(retval))
|
||||
#print(" ##### Is_Corresponding_SessionFormation retval a controle = " + str(retval))
|
||||
if (retval['distantiel'] == diction['distantiel'] and str(retval['date_debut'][0:10]) == diction[
|
||||
'date_debut']
|
||||
and str(retval['date_fin'][0:10]) == diction['date_fin'] and retval['ville'] == diction['ville']):
|
||||
|
@ -3244,16 +3237,8 @@ def Is_Corresponding_SessionFormation(diction):
|
|||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
|
||||
# Si le nombre de session trouvé est > 1 alors incohérence, retourner une message d'erreur
|
||||
if( nb_val > 1 ):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - la query "+str(myquery)+" retourne "+str(nb_val)+" session. ceci n'est pas normal. il ne doit pas y avoir plus 1 session")
|
||||
return False, " Les informations de la session "+str(session_id)+" sont incohérentes. Merci de contacter le support"
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
|
|
Loading…
Reference in New Issue