13/12/2022 - 19h00
parent
efb7260214
commit
7c9d2f0a0f
|
@ -3,10 +3,13 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="26/11/22 - 23h30">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Emargement/test_emargement.pdf" beforeDir="false" afterPath="$PROJECT_DIR$/Emargement/test_emargement.pdf" 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$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.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$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.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" />
|
||||
|
|
|
@ -40,7 +40,7 @@ endobj
|
|||
<<
|
||||
/Contents 11 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 10 0 R /Resources <<
|
||||
/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /XObject <<
|
||||
/FormXob.13be06d0b759aece522fd342e77f07c7 3 0 R
|
||||
/FormXob.72b491439839fdac2ca0e33d4920d251 3 0 R
|
||||
>>
|
||||
>> /Rotate 0 /Trans <<
|
||||
|
||||
|
@ -55,7 +55,7 @@ endobj
|
|||
endobj
|
||||
9 0 obj
|
||||
<<
|
||||
/Author () /CreationDate (D:20221119110934-01'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20221119110934-01'00') /Producer (xhtml2pdf <https://github.com/xhtml2pdf/xhtml2pdf/>)
|
||||
/Author () /CreationDate (D:20221213173356-01'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20221213173356-01'00') /Producer (xhtml2pdf <https://github.com/xhtml2pdf/xhtml2pdf/>)
|
||||
/Subject () /Title () /Trapped /False
|
||||
>>
|
||||
endobj
|
||||
|
@ -66,10 +66,10 @@ endobj
|
|||
endobj
|
||||
11 0 obj
|
||||
<<
|
||||
/Filter [ /ASCII85Decode /FlateDecode ] /Length 2135
|
||||
/Filter [ /ASCII85Decode /FlateDecode ] /Length 2127
|
||||
>>
|
||||
stream
|
||||
Gb!;h9lncS&A@sBbRKl<9]g[IDP;T_U;GKepqU;kq2hq[E3_IVUA4K;1QH'XI9><c6'tU[A\Ij7oo*3]M/4FNn0R,TeV^V5F*@C\19&oR_5-%Ec-P(4q<[G6"+89^ZmrRDc8aqo`P&\e\FFP5>2RPA,L5S+gHp1_"YW7eiD@K/0=I)j4-:KQf9pbdg%[\nHYZme.5!/6$]riHGO*eW]1XdLAL6->\Fd5BW3.VNeDaXN<I)=jrlVS!G>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er
|
||||
<<
|
||||
/ID
|
||||
[<466199d207c1fa5cb7ca79a18ce36005><466199d207c1fa5cb7ca79a18ce36005>]
|
||||
[<9e280ecb619b1263d6a1ec2c297c4a4e><9e280ecb619b1263d6a1ec2c297c4a4e>]
|
||||
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
|
||||
|
||||
/Info 9 0 R
|
||||
|
@ -96,5 +96,5 @@ trailer
|
|||
/Size 12
|
||||
>>
|
||||
startxref
|
||||
10523
|
||||
10515
|
||||
%%EOF
|
||||
|
|
1401
Log/log_file.log
1401
Log/log_file.log
File diff suppressed because one or more lines are too long
170
class_mgt.py
170
class_mgt.py
|
@ -278,7 +278,7 @@ def add_class(diction):
|
|||
|
||||
|
||||
if ("zone_diffusion" in diction.keys()):
|
||||
if diction['zone_diffusion']:
|
||||
if diction['zone_diffusion'] and str(diction['zone_diffusion']) > 0:
|
||||
tmp_str2 = str(diction['zone_diffusion']).lower().replace(",", ";").replace("\r\n", "")
|
||||
|
||||
if (not tmp_str2.endswith(";")):
|
||||
|
@ -334,7 +334,7 @@ def add_class(diction):
|
|||
mydata['datelieu'] = ""
|
||||
|
||||
if ("date_lieu" in diction.keys()):
|
||||
if diction['date_lieu']:
|
||||
if diction['date_lieu'] and str(diction['date_lieu']) > 0 :
|
||||
tmp_str2 = str(diction['date_lieu']).lower().replace(",", ";").replace("\r\n", "")
|
||||
|
||||
print(" ### tmp_str2 = "+str(tmp_str2))
|
||||
|
@ -714,51 +714,55 @@ def update_class(diction):
|
|||
mydata['domaine'] = diction['domaine']
|
||||
|
||||
if ("zone_diffusion" in diction.keys()):
|
||||
tmp_str2 = str(diction['zone_diffusion']).lower().replace(",", ";").replace("\r\n", "")
|
||||
|
||||
if( not tmp_str2.endswith(";")):
|
||||
tmp_str2 = tmp_str2+";"
|
||||
if(len(str(diction['zone_diffusion'])) == 0 ):
|
||||
mydata['zone_diffusion'] = {}
|
||||
else:
|
||||
tmp_str2 = str(diction['zone_diffusion']).lower().replace(",", ";").replace("\r\n", "")
|
||||
|
||||
#print("tmp_str2 = " + tmp_str2)
|
||||
if( not tmp_str2.endswith(";")):
|
||||
tmp_str2 = tmp_str2+";"
|
||||
|
||||
if (";" not in tmp_str2):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - la zone de diffusion de la formation 0: " + str(
|
||||
my_external_code) + " est incorrecte")
|
||||
return False, "La zone de diffusion de la formation " + str(my_external_code) + " est incorrecte"
|
||||
#print("tmp_str2 = " + tmp_str2)
|
||||
|
||||
|
||||
tmp_str = tmp_str2.split(";") #==> ce qui va donner un tableau de : Country_Code-City : ['fr-paris', 'fr-marseille', 'bn-cotonou']
|
||||
cpt = 0
|
||||
tab_country = []
|
||||
tab_city = []
|
||||
for val in tmp_str:
|
||||
|
||||
if (len(str(val)) <= 0):
|
||||
continue
|
||||
|
||||
|
||||
if( "-" not in str(val)):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - la zone de diffusion de la formation 1: " + str( my_external_code) + " est incorrecte")
|
||||
if (";" not in tmp_str2):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - la zone de diffusion de la formation 0: " + str(
|
||||
my_external_code) + " est incorrecte")
|
||||
return False, "La zone de diffusion de la formation " + str(my_external_code) + " est incorrecte"
|
||||
|
||||
|
||||
tab_val = len(val.split("-"))
|
||||
if( len(val.split("-")) != 1 and len(val.split("-")) != 2 ):
|
||||
mycommon.myprint( str(inspect.stack()[0][3]) + " - la zone de diffusion de la formation 2: " + str(my_external_code)+" est incorrecte")
|
||||
return False, "La zone de diffusion de la formation " + str(my_external_code)+" est incorrecte"
|
||||
tmp_str = tmp_str2.split(";") #==> ce qui va donner un tableau de : Country_Code-City : ['fr-paris', 'fr-marseille', 'bn-cotonou']
|
||||
cpt = 0
|
||||
tab_country = []
|
||||
tab_city = []
|
||||
for val in tmp_str:
|
||||
|
||||
if( val.split("-")[0]):
|
||||
tab_country.append(val.split("-")[0])
|
||||
else:
|
||||
tab_country.append("")
|
||||
|
||||
if(val.split("-")[1]):
|
||||
tab_city.append(val.split("-")[1])
|
||||
else:
|
||||
tab_city.append("")
|
||||
if (len(str(val)) <= 0):
|
||||
continue
|
||||
|
||||
|
||||
mydata['zone_diffusion'] = {'country':tab_country, 'city':tab_city}
|
||||
if( "-" not in str(val)):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - la zone de diffusion de la formation 1: " + str( my_external_code) + " est incorrecte")
|
||||
return False, "La zone de diffusion de la formation " + str(my_external_code) + " est incorrecte"
|
||||
|
||||
|
||||
tab_val = len(val.split("-"))
|
||||
if( len(val.split("-")) != 1 and len(val.split("-")) != 2 ):
|
||||
mycommon.myprint( str(inspect.stack()[0][3]) + " - la zone de diffusion de la formation 2: " + str(my_external_code)+" est incorrecte")
|
||||
return False, "La zone de diffusion de la formation " + str(my_external_code)+" est incorrecte"
|
||||
|
||||
if( val.split("-")[0]):
|
||||
tab_country.append(val.split("-")[0])
|
||||
else:
|
||||
tab_country.append("")
|
||||
|
||||
if(val.split("-")[1]):
|
||||
tab_city.append(val.split("-")[1])
|
||||
else:
|
||||
tab_city.append("")
|
||||
|
||||
|
||||
mydata['zone_diffusion'] = {'country':tab_country, 'city':tab_city}
|
||||
|
||||
'''
|
||||
Traitement date_lieu.
|
||||
|
@ -767,7 +771,10 @@ def update_class(diction):
|
|||
'''
|
||||
mydata['datelieu'] = ""
|
||||
if ("date_lieu" in diction.keys()):
|
||||
if diction['date_lieu']:
|
||||
if(len(str(diction['date_lieu'])) == 0 ):
|
||||
mydata['datelieu'] = {}
|
||||
|
||||
else:
|
||||
tmp_str2 = str(diction['date_lieu']).lower().replace(",", ";").replace("\r\n", "")
|
||||
|
||||
if (not tmp_str2.endswith(";")):
|
||||
|
@ -2482,23 +2489,23 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
|||
|
||||
for n in x:
|
||||
mydata = {}
|
||||
mydata['external_code'] = str(df['external_code'].values[n])
|
||||
mydata['title'] = str(df['titre'].values[n])
|
||||
mydata['domaine'] = str(df['domaine'].values[n])
|
||||
mydata['description'] = str(df['description'].values[n])
|
||||
mydata['external_code'] = str(df['external_code'].values[n]).strip()
|
||||
mydata['title'] = str(df['titre'].values[n]).strip()
|
||||
mydata['domaine'] = str(df['domaine'].values[n]).strip()
|
||||
mydata['description'] = str(df['description'].values[n]).strip()
|
||||
|
||||
|
||||
formateur = ""
|
||||
if ("formateur" in df.keys()):
|
||||
if (str(df['formateur'].values[n])):
|
||||
formateur = str(df['formateur'].values[n])
|
||||
formateur = str(df['formateur'].values[n]).strip()
|
||||
mydata['trainer'] = formateur
|
||||
|
||||
|
||||
institut_formation = ""
|
||||
if ("institut_formation" in df.keys()):
|
||||
if (str(df['institut_formation'].values[n])):
|
||||
institut_formation = str(df['institut_formation'].values[n])
|
||||
institut_formation = str(df['institut_formation'].values[n]).strip()
|
||||
mydata['institut_formation'] = institut_formation
|
||||
|
||||
|
||||
|
@ -2507,109 +2514,129 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
|||
url = ""
|
||||
if ("url" in df.keys()):
|
||||
if (str(df['url'].values[n])):
|
||||
url = str(df['url'].values[n])
|
||||
url = str(df['url'].values[n]).strip()
|
||||
mydata['url'] = url
|
||||
|
||||
duration = 0
|
||||
duration = "0"
|
||||
if ("duree" in df.keys()):
|
||||
if (str(df['duree'].values[n])):
|
||||
plus_produit = str(df['duree'].values[n])
|
||||
plus_produit = str(df['duree'].values[n]).strip()
|
||||
mydata['duration'] = duration
|
||||
|
||||
|
||||
plus_produit = ""
|
||||
if ("plus_produit" in df.keys()):
|
||||
if (str(df['plus_produit'].values[n])):
|
||||
plus_produit = str(df['plus_produit'].values[n])
|
||||
plus_produit = str(df['plus_produit'].values[n]).strip()
|
||||
mydata['plus_produit'] = plus_produit
|
||||
|
||||
mots_cle = ""
|
||||
if ("mots_cle" in df.keys()):
|
||||
if (str(df['mots_cle'].values[n])):
|
||||
presentiel = str(df['mots_cle'].values[n])
|
||||
presentiel = str(df['mots_cle'].values[n]).strip()
|
||||
mydata['mots_cle'] = mots_cle
|
||||
|
||||
|
||||
presentiel = "0"
|
||||
if ("presentiel" in df.keys()):
|
||||
if (str(df['presentiel'].values[n])):
|
||||
presentiel = str(df['presentiel'].values[n])
|
||||
presentiel = str(df['presentiel'].values[n]).strip()
|
||||
mydata['presentiel'] = presentiel
|
||||
|
||||
distantiel = "0"
|
||||
if ("distantiel" in df.keys()):
|
||||
if (str(df['distantiel'].values[n])):
|
||||
distantiel = str(df['distantiel'].values[n])
|
||||
distantiel = str(df['distantiel'].values[n]).strip()
|
||||
mydata['distantiel'] = distantiel
|
||||
|
||||
|
||||
price = "0"
|
||||
if ("prix" in df.keys()):
|
||||
if (str(df['prix'].values[n])):
|
||||
price = str(df['prix'].values[n])
|
||||
price = str(df['prix'].values[n]).strip()
|
||||
mydata['price'] = price
|
||||
|
||||
|
||||
|
||||
metier = "1"
|
||||
if ("metier" in df.keys()):
|
||||
if (str(df['metier'].values[n])):
|
||||
metier = str(df['metier'].values[n])
|
||||
metier = str(df['metier'].values[n]).strip()
|
||||
mydata['metier'] = metier
|
||||
|
||||
|
||||
published = "1"
|
||||
if ("published" in df.keys()):
|
||||
if (str(df['published'].values[n])):
|
||||
published = str(df['published'].values[n])
|
||||
published = str(df['published'].values[n]).strip()
|
||||
mydata['published'] = published
|
||||
|
||||
|
||||
mycpf = "0"
|
||||
if ("cpf" in df.keys()):
|
||||
if (str(df['cpf'].values[n])):
|
||||
mydata['cpf'] = str(df['cpf'].values[n])
|
||||
mycpf = str(df['cpf'].values[n]).strip()
|
||||
mydata['cpf'] = mycpf
|
||||
|
||||
class_inscription_url = ""
|
||||
if ("class_inscription_url" in df.keys()):
|
||||
if (str(df['class_inscription_url'].values[n])):
|
||||
mydata['class_inscription_url'] = str(df['class_inscription_url'].values[n])
|
||||
class_inscription_url = str(df['class_inscription_url'].values[n]).strip()
|
||||
mydata['class_inscription_url'] = class_inscription_url
|
||||
|
||||
certif = "0"
|
||||
if ("certif" in df.keys()):
|
||||
if (str(df['certif'].values[n])):
|
||||
mydata['certif'] = str(df['certif'].values[n])
|
||||
certif = str(df['certif'].values[n]).strip()
|
||||
mydata['certif'] = certif
|
||||
|
||||
objectif = ""
|
||||
if ("objectif" in df.keys()):
|
||||
if (str(df['objectif'].values[n])):
|
||||
mydata['objectif'] = str(df['objectif'].values[n])
|
||||
objectif = str(df['objectif'].values[n]).strip()
|
||||
mydata['objectif'] = objectif
|
||||
|
||||
note = ""
|
||||
if ("note" in df.keys()):
|
||||
if (str(df['note'].values[n])):
|
||||
mydata['note'] = str(df['note'].values[n])
|
||||
note = str(df['note'].values[n]).strip()
|
||||
mydata['note'] = note
|
||||
|
||||
programme = ""
|
||||
if ("programme" in df.keys()):
|
||||
if (str(df['programme'].values[n])):
|
||||
mydata['programme'] = str(df['programme'].values[n])
|
||||
programme = str(df['programme'].values[n]).strip()
|
||||
mydata['programme'] = programme
|
||||
|
||||
prerequis = ""
|
||||
if ("prerequis" in df.keys()):
|
||||
if (str(df['prerequis'].values[n])):
|
||||
mydata['prerequis'] = str(df['prerequis'].values[n])
|
||||
prerequis = str(df['prerequis'].values[n]).strip()
|
||||
mydata['prerequis'] = prerequis
|
||||
|
||||
pourqui = ""
|
||||
if ("pourqui" in df.keys()):
|
||||
if (str(df['pourqui'].values[n])):
|
||||
mydata['pourqui'] = str(df['pourqui'].values[n])
|
||||
pourqui = str(df['pourqui'].values[n]).strip()
|
||||
mydata['pourqui'] = pourqui
|
||||
|
||||
support = ""
|
||||
if ("support" in df.keys()):
|
||||
if (str(df['support'].values[n])):
|
||||
mydata['support'] = str(df['support'].values[n])
|
||||
support = str(df['support'].values[n]).strip()
|
||||
mydata['support'] = support
|
||||
|
||||
img_banner_detail_class = ""
|
||||
if ("img_banner_detail_class" in df.keys()):
|
||||
if (str(df['img_banner_detail_class'].values[n])):
|
||||
mydata['img_banner_detail_class'] = str(df['img_banner_detail_class'].values[n])
|
||||
img_banner_detail_class = str(df['img_banner_detail_class'].values[n]).strip()
|
||||
mydata['img_banner_detail_class'] = img_banner_detail_class
|
||||
|
||||
|
||||
'''
|
||||
Verification de l'image
|
||||
'''
|
||||
if ("img_url" in df.keys()):
|
||||
mydata['img_url'] = str(df['img_url'].values[n])
|
||||
mydata['img_url'] = str(df['img_url'].values[n]).strip()
|
||||
if (str(df['img_url'].values[n]) == 'nan'):
|
||||
mydata['img_url'] = ""
|
||||
|
||||
|
@ -2638,16 +2665,23 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
|||
'''
|
||||
Traitement de la zone de diffusion
|
||||
'''
|
||||
zone_diffusion = ""
|
||||
if ("zone_diffusion" in df.keys()):
|
||||
if(str(df['zone_diffusion'].values[n])):
|
||||
mydata['zone_diffusion'] =str(df['zone_diffusion'].values[n])
|
||||
zone_diffusion =str(df['zone_diffusion'].values[n]).strip()
|
||||
|
||||
mydata['zone_diffusion'] = zone_diffusion
|
||||
|
||||
'''
|
||||
Traitement des date et lieu de la formation
|
||||
'''
|
||||
date_lieu = ""
|
||||
if ("date_lieu" in df.keys()):
|
||||
if(str(df['date_lieu'].values[n])):
|
||||
mydata['date_lieu'] =str(df['date_lieu'].values[n])
|
||||
date_lieu =str(df['date_lieu'].values[n]).strip()
|
||||
|
||||
mydata['date_lieu'] = date_lieu
|
||||
|
||||
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
,index,mots,occurence,moyenne,id_formation,source_field
|
||||
0,0,prise,1,0.33,3IL_10006,title
|
||||
1,1,parole,1,0.33,3IL_10006,title
|
||||
2,2,public,1,0.33,3IL_10006,title
|
||||
0,0,intelligence,1,0.17,test_0002,title
|
||||
1,1,professionnel,1,0.17,test_0002,title
|
||||
2,2,entretien,1,0.17,test_0002,title
|
||||
3,3,emotionnelle,1,0.17,test_0002,title
|
||||
4,4,developper,1,0.17,test_0002,title
|
||||
5,5,preparer,1,0.17,test_0002,title
|
||||
|
|
|
|
@ -1,3 +1,7 @@
|
|||
Empty DataFrame
|
||||
Columns: [mots, occurence, moyenne, id_formation, source_field]
|
||||
Index: []
|
||||
mots occurence moyenne id_formation source_field
|
||||
0 intelligence 1 0.17 test_0002 title
|
||||
1 professionnel 1 0.17 test_0002 title
|
||||
2 entretien 1 0.17 test_0002 title
|
||||
3 emotionnelle 1 0.17 test_0002 title
|
||||
4 developper 1 0.17 test_0002 title
|
||||
5 preparer 1 0.17 test_0002 title
|
|
@ -94,17 +94,15 @@ def CreateTableauEmargement(diction):
|
|||
ville = ""
|
||||
code_postal = ""
|
||||
adresse = ""
|
||||
for tmp_val in MYSY_GV.dbname['myclass'].find({"internal_url":str(class_internal_url),
|
||||
"datelieu.session_id": str(session_id)}):
|
||||
for tmp_val in MYSY_GV.dbname['session_formation'].find({"class_internal_url":str(class_internal_url),
|
||||
"formation_session_id": str(session_id)}):
|
||||
|
||||
tmp_date_lieu = tmp_val['datelieu']
|
||||
for val in tmp_date_lieu:
|
||||
if (val['session_id'] == str(session_id)):
|
||||
date_du = val['date_du']
|
||||
date_au = val['date_au']
|
||||
ville = val['ville']
|
||||
code_postal = val['code_postal']
|
||||
code_postal = val['adresse']
|
||||
|
||||
date_du = str(tmp_val['date_debut'])[0:10]
|
||||
date_au = str(tmp_val['date_fin'])[0:10]
|
||||
ville = tmp_val['ville']
|
||||
code_postal = tmp_val['code_postal']
|
||||
adresse = tmp_val['adresse']
|
||||
|
||||
is_date_du = mycommon.CheckisDate(date_du)
|
||||
is_date_au = mycommon.CheckisDate(date_au)
|
||||
|
@ -117,14 +115,23 @@ def CreateTableauEmargement(diction):
|
|||
date_emargement = datetime.strptime(str(date_du), '%d/%m/%Y')
|
||||
i = 0 # compteur de securité
|
||||
|
||||
|
||||
# On vide la collection emargement pour la session = str(session_id)
|
||||
local_myquery = {"session_id": str(session_id)}
|
||||
x = MYSY_GV.dbname['emargement'].delete_many(local_myquery)
|
||||
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - INFO : "+str(x.deleted_count)+" Documents supprimés de la collection : emargement : session = "+str(session_id) )
|
||||
|
||||
liste_date = []
|
||||
print(" Date du = "+str(date_du)+" CMP Date au ="+str(date_au))
|
||||
#print(" Date du = "+str(date_du)+" CMP Date au ="+str(date_au))
|
||||
while( date_emargement < datetime.strptime(str(date_au), '%d/%m/%Y') and i < 360):
|
||||
date_10 = str(date_emargement)
|
||||
liste_date.append(date_10[0:10])
|
||||
i = i + 1
|
||||
date_emargement = date_emargement + timedelta(days=1)
|
||||
##print(" ### date_emargement = "+str(date_emargement) + " < "+str(datetime.strptime(str(date_au), '%d/%m/%Y') ))
|
||||
#print(" ### date_emargement = "+str(date_emargement) + " < "+str(datetime.strptime(str(date_au), '%d/%m/%Y') ))
|
||||
|
||||
|
||||
#print("#### Liste Date = "+str(liste_date))
|
||||
|
|
16
partners.py
16
partners.py
|
@ -934,7 +934,7 @@ def partner_login(diction):
|
|||
try:
|
||||
|
||||
# Dictionnaire des champs utilisables
|
||||
field_list = ['email', 'pwd', 'secret']
|
||||
field_list = ['email', 'pwd', ]
|
||||
incom_keys = diction.keys()
|
||||
|
||||
'''
|
||||
|
@ -952,7 +952,7 @@ def partner_login(diction):
|
|||
Une fois qu'on a controlé que toutes les clés mise dans l'API sont correcte. etape precedente,
|
||||
On controle que les champs obligatoires sont presents dans la liste
|
||||
'''
|
||||
field_list_obligatoire = ['email', 'pwd', 'secret']
|
||||
field_list_obligatoire = ['email', 'pwd', ]
|
||||
for val in field_list_obligatoire:
|
||||
if str(val).lower() not in diction:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " La valeur '" + val + "' n'est pas presente dans liste des champs")
|
||||
|
@ -972,20 +972,17 @@ def partner_login(diction):
|
|||
if diction['pwd']:
|
||||
pwd = diction['pwd']
|
||||
|
||||
if ("secret" in diction.keys()):
|
||||
if diction['secret']:
|
||||
token = diction['secret']
|
||||
mydata['token'] = diction['secret']
|
||||
|
||||
now = str(datetime.now())
|
||||
|
||||
mydata['valide'] = "1"
|
||||
mydata['date_update'] = now
|
||||
|
||||
partner_key_secrete_key = ""
|
||||
|
||||
# Verification que les informations sont juste
|
||||
coll_name = MYSY_GV.dbname['partnair_account']
|
||||
ret_val = coll_name.find_one_and_update({'email': str(email), 'pwd': str(pwd), 'token': str(token), 'active': '1', 'locked':'0'},
|
||||
ret_val = coll_name.find_one_and_update({'email': str(email), 'pwd': str(pwd), 'active': '1', 'locked':'0'},
|
||||
{"$set": {'last_connexion':str(now)}},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
|
@ -996,6 +993,7 @@ def partner_login(diction):
|
|||
# Vu que les credentials sont ok, alors enregistrement de la connexion dans la table "partner token"
|
||||
|
||||
#print(" GRRRRRRRRRRRRRRRRRRR "+str(ret_val))
|
||||
partner_key_secrete_key = str(ret_val['token'])
|
||||
mydata['recid'] = str(ret_val['recid'])
|
||||
token_collection = MYSY_GV.dbname['partner_token']
|
||||
|
||||
|
@ -1012,7 +1010,7 @@ def partner_login(diction):
|
|||
return False, " Impossible de se connecter"
|
||||
|
||||
|
||||
return True, " Partner Connexion : OK"
|
||||
return True, partner_key_secrete_key
|
||||
else:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Impossible de se connecter - Partner ")
|
||||
return False, " Impossible de se connecter"
|
||||
|
@ -1021,7 +1019,7 @@ def partner_login(diction):
|
|||
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))
|
||||
return False, " Impossible de recuperer la formation"
|
||||
return False, " Impossible de connecter le partenaire"
|
||||
|
||||
|
||||
"""
|
||||
|
|
|
@ -1946,13 +1946,16 @@ def CreateInternalUrl(sentence=None):
|
|||
my_internal_url = my_internal_url.replace("--", "-")
|
||||
my_internal_url = my_internal_url.replace(" ", "-")
|
||||
my_internal_url = my_internal_url.replace("/", "-")
|
||||
|
||||
if (my_internal_url.startswith('-')):
|
||||
my_internal_url = my_internal_url[1:]
|
||||
|
||||
if (my_internal_url.endswith('-')):
|
||||
my_internal_url = my_internal_url[:-1]
|
||||
|
||||
suffix = hashlib.md5(my_internal_url.encode()).hexdigest()
|
||||
|
||||
suffix = hashlib.md5(str(datetime.now()).encode()).hexdigest()
|
||||
|
||||
final_internal_url = str(my_internal_url) + "-" + str(suffix[-3:])
|
||||
final_internal_url = final_internal_url.replace("--", "-")
|
||||
internal_url = final_internal_url
|
||||
|
|
Loading…
Reference in New Issue