24 lines
572 B
Python
24 lines
572 B
Python
from flask import request
|
|
|
|
from ...config import config, save_config
|
|
from ...api.actions.install import install
|
|
|
|
import logging
|
|
logger = logging.getLogger(__name__)
|
|
|
|
from .blueprint import api
|
|
|
|
@api.route("/install", methods=["POST"])
|
|
def post_install():
|
|
try:
|
|
body = request.json
|
|
except:
|
|
logger.debug("Installing with config.ini params")
|
|
else:
|
|
if body.get("query_string"):
|
|
config["DataBase"]["query"] = body.get("query_string")
|
|
save_config()
|
|
finally:
|
|
install()
|
|
return { "status": "ok" }, 200
|
|
|