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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user