mise à jour des routes pour les paramètres suite à la suppression du mode d'operation dans la page: paramètres

This commit is contained in:
Vincent BENOIT
2022-12-01 11:53:30 +01:00
parent e1d2671149
commit 27387991e3
2 changed files with 3 additions and 7 deletions

View File

@@ -76,8 +76,8 @@ def retreive_params():
try:
with open(current_app.config['DB_PATH'], 'r') as f:
data = json.load(f)
if 'OPERATION' and 'PIN_ACTIF' and 'CODE_PIN' and 'NUM_AUTORISE' and 'TONE_DURATION' and 'DTMF_CODE' and 'DTMF_DURATION' in data:
content = {'operation': data['OPERATION'], 'pin_actif': data['PIN_ACTIF'], 'code_pin': data['CODE_PIN'], 'num_autorized': data['NUM_AUTORISE'], 'tone_duration': data['TONE_DURATION'], 'dtmf_code': data['DTMF_CODE'], 'dtmf_duration': data['DTMF_DURATION']}
if 'PIN_ACTIF' and 'CODE_PIN' and 'NUM_AUTORISE' and 'TONE_DURATION' and 'DTMF_CODE' and 'DTMF_DURATION' in data:
content = {'pin_actif': data['PIN_ACTIF'], 'code_pin': data['CODE_PIN'], 'num_autorized': data['NUM_AUTORISE'], 'tone_duration': data['TONE_DURATION'], 'dtmf_code': data['DTMF_CODE'], 'dtmf_duration': data['DTMF_DURATION']}
else:
abort(status.HTTP_406_NOT_ACCEPTABLE, description="paramètres manquant en base de données")
except FileNotFoundError as e:
@@ -104,10 +104,6 @@ def update_params():
current_app.logger.error("Fichier ({}) manquant".format(current_app.config['DB_PATH']))
abort(status.HTTP_406_NOT_ACCEPTABLE, description="Fichier manquant")
if 'operation' in data_req:
data['OPERATION'] = data_req['operation']
else:
abort(status.HTTP_406_NOT_ACCEPTABLE, description="paramètre manquant")
if 'pin_actif' in data_req:
data['PIN_ACTIF'] = data_req['pin_actif']
else:

File diff suppressed because one or more lines are too long