Validation 19/02/22 - 21h00

master
ChérifBALDE 2022-02-20 21:09:05 +01:00 committed by cherif
parent 5c9f94504a
commit 8e9f8e4e7e
2 changed files with 9 additions and 4 deletions

View File

@ -44,11 +44,11 @@ def add_class(diction):
# field_list.
'''
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel', 'presentiel',
'price', 'url','duree_formation','token', 'plus_produit', 'mots_cle']
'price', 'url','duree_formation','token', 'plus_produit', 'mots_cle','domaine']
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list:
mycommon.myprint(str(inspect.stack()[0][3])+" - Creation formation : Le champ '" + val + "' n'existe pas, Creation formation annulée")
mycommon.myprint(str(inspect.stack()[0][3])+" - Creation formation : Le champ '" + val + "' n'est pas autorisé, Creation formation annulée")
return False, " Verifier votre API"
'''
@ -154,6 +154,11 @@ def add_class(diction):
mydata['mots_cle'] = diction['mots_cle']
if ("domaine" in diction.keys()):
if diction['domaine']:
mydata['domaine'] = diction['domaine']
mydata['valide'] = '1'
mydata['locked'] = '0'
mydata['indexed'] = '0'
@ -843,7 +848,7 @@ def get_class(diction):
filt_title = {'title': {'$regex': str(diction['title'])}}
print(" ATTTTENNTION : GESTION DU CAS OU LA PERSONNE QUI CHERCHE LE COURS EST UN UTILISATEUR : PB avec : partner_owner_recid ")
print(" #### avant requete get partner_owner_recid ="+str(user_recid)+
" filt_external_code = "+str(filt_external_code)+
" filt_title = "+str(filt_title))

View File

@ -214,7 +214,7 @@ def update_user_account():
return jsonify(status=status, message=retval)
@app.route('/myclass/api/create_class/', methods=['POST'])
@app.route('/myclass/api/create_class/', methods=['POST','GET'])
@crossdomain(origin='*')
def create_class():
# On recupere le corps (payload) de la requete