mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
adjusted config setting for avoiding restart
This commit is contained in:
parent
e284a58db9
commit
6f64b61ea5
|
@ -96,6 +96,10 @@ def index():
|
||||||
@app.route('/config', methods=['GET', 'POST'])
|
@app.route('/config', methods=['GET', 'POST'])
|
||||||
def config():
|
def config():
|
||||||
if request.method in ['POST']:
|
if request.method in ['POST']:
|
||||||
|
# check if config already exists
|
||||||
|
if app.config_manager.read() == request.json:
|
||||||
|
return api_response(request.json)
|
||||||
|
|
||||||
set_config = app.config_manager.write(request.json)
|
set_config = app.config_manager.write(request.json)
|
||||||
if not set_config:
|
if not set_config:
|
||||||
response = api_response(None, 'error writing config')
|
response = api_response(None, 'error writing config')
|
||||||
|
|
Loading…
Reference in a new issue