Validation 19/02/22 - 21h00
parent
5c9f94504a
commit
8e9f8e4e7e
11
class_mgt.py
11
class_mgt.py
|
@ -44,11 +44,11 @@ def add_class(diction):
|
||||||
# field_list.
|
# field_list.
|
||||||
'''
|
'''
|
||||||
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel', 'presentiel',
|
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()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
if val not in field_list:
|
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"
|
return False, " Verifier votre API"
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
@ -154,6 +154,11 @@ def add_class(diction):
|
||||||
mydata['mots_cle'] = diction['mots_cle']
|
mydata['mots_cle'] = diction['mots_cle']
|
||||||
|
|
||||||
|
|
||||||
|
if ("domaine" in diction.keys()):
|
||||||
|
if diction['domaine']:
|
||||||
|
mydata['domaine'] = diction['domaine']
|
||||||
|
|
||||||
|
|
||||||
mydata['valide'] = '1'
|
mydata['valide'] = '1'
|
||||||
mydata['locked'] = '0'
|
mydata['locked'] = '0'
|
||||||
mydata['indexed'] = '0'
|
mydata['indexed'] = '0'
|
||||||
|
@ -843,7 +848,7 @@ def get_class(diction):
|
||||||
filt_title = {'title': {'$regex': str(diction['title'])}}
|
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)+
|
print(" #### avant requete get partner_owner_recid ="+str(user_recid)+
|
||||||
" filt_external_code = "+str(filt_external_code)+
|
" filt_external_code = "+str(filt_external_code)+
|
||||||
" filt_title = "+str(filt_title))
|
" filt_title = "+str(filt_title))
|
||||||
|
|
2
main.py
2
main.py
|
@ -214,7 +214,7 @@ def update_user_account():
|
||||||
return jsonify(status=status, message=retval)
|
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='*')
|
@crossdomain(origin='*')
|
||||||
def create_class():
|
def create_class():
|
||||||
# On recupere le corps (payload) de la requete
|
# On recupere le corps (payload) de la requete
|
||||||
|
|
Loading…
Reference in New Issue