update 01/03/2022 - 15h30
parent
488cb7d7ef
commit
8710f9538a
4231
Log/log_file.log
4231
Log/log_file.log
File diff suppressed because it is too large
Load Diff
41
class_mgt.py
41
class_mgt.py
|
@ -764,7 +764,9 @@ def get_class(diction):
|
|||
# Ici on doit mettre tous les champs possible (obligatoire ou non) de la BDD dans la liste
|
||||
# field_list.
|
||||
'''
|
||||
field_list = ['external_code', 'token', 'title', 'valide', 'locked']
|
||||
field_list = ['external_code', 'token', 'title', 'valide', 'locked', 'user_ip', 'user_country_code', 'user_country_name', 'user_city',
|
||||
'user_postal', 'user_latitude', 'user_longitude', 'user_state']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
|
@ -826,6 +828,8 @@ def get_class(diction):
|
|||
'''
|
||||
|
||||
user_recid = "None"
|
||||
coll_search_result = dbname['user_recherche_result']
|
||||
|
||||
# Verification de la validité du token/mail dans le cas des user en mode connecté
|
||||
if (len(str(my_token)) > 0):
|
||||
retval = mycommon.check_token_validity("", my_token)
|
||||
|
@ -857,10 +861,45 @@ def get_class(diction):
|
|||
|
||||
for retVal in coll_name.find(({"$and": [ {'valide':'1'},{'locked':'0'},
|
||||
filt_external_code, filt_title ]})):
|
||||
'''
|
||||
Statistique : Une fois qu'une personne veut acceder aux detail d'une formation
|
||||
alors on ajout aux statut le faite que la formation a été ouverte/
|
||||
'''
|
||||
my_recid = {}
|
||||
my_recid['user_rec_id'] = str(user_recid)
|
||||
mydict_combined = {**diction, **retVal, **my_recid}
|
||||
mydict_combined['date_update'] = str(datetime.now())
|
||||
mydict_combined['type_view'] = "detail"
|
||||
|
||||
if ("_id" in mydict_combined.keys()):
|
||||
mydict_combined['class_id'] = mydict_combined.pop('_id')
|
||||
|
||||
mycommon.myprint("COMBINED = " + str(mydict_combined))
|
||||
|
||||
'''
|
||||
Statistique : Insertion du recherche - resultat '''
|
||||
ret_val_tmp = coll_search_result.insert_one(mydict_combined)
|
||||
if (ret_val_tmp is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de mettre à jour la table des resultat"
|
||||
" d'une recherche de formation. Voir _id = ")
|
||||
|
||||
if (ret_val_tmp is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de mettre à jour la table des resultat"
|
||||
" d'une recherche de formation. Voir _id = ")
|
||||
return False, "Impossible de faire un affichage detaillé "
|
||||
|
||||
|
||||
|
||||
|
||||
mycommon.myprint(str(retVal))
|
||||
user = retVal
|
||||
RetObject.append(JSONEncoder().encode(user))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
|
|
|
@ -395,6 +395,8 @@ def recherche_text_simple(diction):
|
|||
my_recid['user_rec_id'] = str(user_recid)
|
||||
mydict_combined = {**diction, **x, **my_recid}
|
||||
mydict_combined['date_update'] = str(datetime.now())
|
||||
mydict_combined['type_view'] = "summary"
|
||||
|
||||
if ("_id" in mydict_combined.keys()):
|
||||
mydict_combined['class_id'] = mydict_combined.pop('_id')
|
||||
|
||||
|
@ -419,6 +421,7 @@ def recherche_text_simple(diction):
|
|||
my_recid['user_rec_id'] = str(user_recid)
|
||||
mydict_combined = {**diction, **my_recid}
|
||||
mydict_combined['date_update'] = str(datetime.now())
|
||||
mydict_combined['type_view'] = "summary"
|
||||
|
||||
|
||||
'''
|
||||
|
@ -458,6 +461,8 @@ def recherche_text_simple(diction):
|
|||
my_recid['user_rec_id'] = str(user_recid)
|
||||
mydict_combined = {**diction, **x, **my_recid}
|
||||
mydict_combined['date_update'] = str(datetime.now())
|
||||
mydict_combined['type_view'] = "summary"
|
||||
|
||||
if ("_id" in mydict_combined.keys()):
|
||||
mydict_combined['class_id'] = mydict_combined.pop('_id')
|
||||
|
||||
|
@ -482,6 +487,7 @@ def recherche_text_simple(diction):
|
|||
my_recid['user_rec_id'] = str(user_recid)
|
||||
mydict_combined = {**diction, **my_recid}
|
||||
mydict_combined['date_update'] = str(datetime.now())
|
||||
mydict_combined['type_view'] = "summary"
|
||||
|
||||
'''
|
||||
Statistique : Insertion du recherche - resultat '''
|
||||
|
|
Loading…
Reference in New Issue