20/12/22 - 11h30
parent
6d6c04f66e
commit
4b486320a7
|
@ -1,13 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="15/12/2022 - 22h00">
|
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="16/12/2022 - 22h00">
|
||||||
<change afterPath="$PROJECT_DIR$/Attestation_Certificat.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" 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$/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$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
@ -144,7 +141,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1671139302487</updated>
|
<updated>1671139302487</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="11" />
|
<task id="LOCAL-00011" summary="16/12/2022 - 22h00">
|
||||||
|
<created>1671221923143</created>
|
||||||
|
<option name="number" value="00011" />
|
||||||
|
<option name="presentableId" value="LOCAL-00011" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1671221923143</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="12" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
@ -168,16 +172,12 @@
|
||||||
<MESSAGE value="26/11/22 - 10h30" />
|
<MESSAGE value="26/11/22 - 10h30" />
|
||||||
<MESSAGE value="26/11/22 - 23h30" />
|
<MESSAGE value="26/11/22 - 23h30" />
|
||||||
<MESSAGE value="15/12/2022 - 22h00" />
|
<MESSAGE value="15/12/2022 - 22h00" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="15/12/2022 - 22h00" />
|
<MESSAGE value="16/12/2022 - 22h00" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="16/12/2022 - 22h00" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<breakpoint-manager>
|
<breakpoint-manager>
|
||||||
<breakpoints>
|
<breakpoints>
|
||||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
|
||||||
<url>file://$PROJECT_DIR$/main.py</url>
|
|
||||||
<line>252</line>
|
|
||||||
<option name="timeStamp" value="1" />
|
|
||||||
</line-breakpoint>
|
|
||||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
||||||
<url>file://$PROJECT_DIR$/Session_Formation.py</url>
|
<url>file://$PROJECT_DIR$/Session_Formation.py</url>
|
||||||
<line>4</line>
|
<line>4</line>
|
||||||
|
|
|
@ -1075,3 +1075,69 @@ def PrintAttendeeDetail_perSession(diction):
|
||||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||||
return False, " Impossible d'imprimer la fiche detaillée"
|
return False, " Impossible d'imprimer la fiche detaillée"
|
||||||
|
|
||||||
|
|
||||||
|
""" Creation d'un evaluation sur une formation
|
||||||
|
Les infos d'evaluation sont rattachées à la collection inscription.
|
||||||
|
|
||||||
|
eval_date :
|
||||||
|
eval_note :
|
||||||
|
eval_eval :
|
||||||
|
"""
|
||||||
|
def Evaluation(dicton):
|
||||||
|
try:
|
||||||
|
|
||||||
|
return True
|
||||||
|
except Exception as e:
|
||||||
|
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
|
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||||
|
return False, " Impossible de créer l'evaluation"
|
||||||
|
|
||||||
|
"""
|
||||||
|
Cette fonction verifie si un token d'evaluation est valide.
|
||||||
|
|
||||||
|
Un token est valide si :
|
||||||
|
token = ObjectId existe
|
||||||
|
internal_url et le objectId sont coherents (meme ligne dans la collection)
|
||||||
|
L'evaluation n'a pas deja ete faite.
|
||||||
|
|
||||||
|
"""
|
||||||
|
def MySyckeckEvaluationToken(diction):
|
||||||
|
try:
|
||||||
|
field_list_obligatoire = ['eval_token', 'class_internal_url']
|
||||||
|
|
||||||
|
for val in field_list_obligatoire:
|
||||||
|
if val not in diction:
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][
|
||||||
|
3]) + " La valeur '" + val + "' n'est pas presente dans liste ")
|
||||||
|
return False, " Les informations fournies sont incorrectes"
|
||||||
|
|
||||||
|
eval_token = ""
|
||||||
|
if ("eval_token" in diction.keys()):
|
||||||
|
if diction['eval_token']:
|
||||||
|
eval_token = diction['eval_token']
|
||||||
|
|
||||||
|
internal_url = ""
|
||||||
|
if ("class_internal_url" in diction.keys()):
|
||||||
|
if diction['class_internal_url']:
|
||||||
|
internal_url = diction['class_internal_url']
|
||||||
|
|
||||||
|
#local_qry = {'class_internal_url':internal_url, '_id': ObjectId(eval_token), "eval_date":{"$exists":False} }
|
||||||
|
|
||||||
|
#print(" ### local_qry =",local_qry)
|
||||||
|
tmp_count = MYSY_GV.dbname['inscription'].count_documents({'class_internal_url':internal_url,
|
||||||
|
'_id': ObjectId(eval_token), "eval_date":{"$exists":False} } )
|
||||||
|
|
||||||
|
if (tmp_count != 1):
|
||||||
|
mycommon.myprint(str(inspect.stack()[0][3]) + " "+str(tmp_count)+" est different de 1. impossible de faire l'evaluation")
|
||||||
|
return False, " Impossible de faire l'evaluation. Verifier les informations fournies"
|
||||||
|
|
||||||
|
print(" ### IL YA BIEN UNE EVAL A FAIRE")
|
||||||
|
return True, "Ok"
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
|
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||||
|
return False, " Impossible de verifier la validé du token"
|
||||||
|
|
||||||
|
|
1147
Log/log_file.log
1147
Log/log_file.log
File diff suppressed because it is too large
Load Diff
11
main.py
11
main.py
|
@ -2185,6 +2185,17 @@ def PrintAttendeeDetail_perSession(token, session_id, attendee_email):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
""" API de verification du token d'evaluation
|
||||||
|
"""
|
||||||
|
@app.route('/myclass/api/MySyckeckEvaluationToken/', methods=['POST','GET'])
|
||||||
|
@crossdomain(origin='*')
|
||||||
|
def MySyckeckEvaluationToken():
|
||||||
|
# On recupere le corps (payload) de la requete
|
||||||
|
payload = request.form.to_dict()
|
||||||
|
print(" ### ckeckEvaluationToken : payload = ",payload)
|
||||||
|
localStatus, message= inscription.MySyckeckEvaluationToken(payload)
|
||||||
|
return jsonify(status=localStatus, message=message )
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(" debut api")
|
print(" debut api")
|
||||||
|
|
Loading…
Reference in New Issue