06/10/22 - 10h

master
ChérifBALDE 2022-10-06 10:42:05 +02:00 committed by cherif
parent bde13eac9c
commit a6f794d905
1 changed files with 18 additions and 7 deletions

View File

@ -75,10 +75,12 @@ def get_user_objectif(diction):
query['active'] = '1'
name_defined = 0
if ("name" in diction.keys()):
if diction['name']:
name = diction['name']
query['name'] = diction['name']
name_defined = 1
user_recid = "None"
# Verification de la validité du token/mail dans le cas des user en mode connecté
@ -110,13 +112,22 @@ def get_user_objectif(diction):
RetObject = []
print(" ### my query = "+str(query))
for retVal in coll_name.find(query):
#mycommon.myprint(retVal)
user = retVal
user['id'] = str(val_tmp)
val_tmp = val_tmp+1
print(" #### user = "+str(user))
RetObject.append(JSONEncoder().encode(user))
if( name_defined == 1 ):
for retVal in coll_name.find(query).limit(1):
#mycommon.myprint(retVal)
user = retVal
user['id'] = str(val_tmp)
val_tmp = val_tmp+1
print(" #### user = "+str(user))
RetObject.append(JSONEncoder().encode(user))
else :
for retVal in coll_name.find(query):
#mycommon.myprint(retVal)
user = retVal
user['id'] = str(val_tmp)
val_tmp = val_tmp+1
print(" #### user = "+str(user))
RetObject.append(JSONEncoder().encode(user))
return True, RetObject