fix that fucking thing now

This commit is contained in:
gauthiier 2019-12-29 17:57:27 +01:00
parent 9e57568642
commit 9c6ea7e1be

View File

@ -5,6 +5,7 @@ import config
from datetime import datetime from datetime import datetime
import os, logging import os, logging
lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password'])
@app.route('/') @app.route('/')
def index(): def index():
@ -23,6 +24,8 @@ def lists():
@app.route('/search') @app.route('/search')
def searh(): def searh():
global lists_to_serve
if len(request.args) < 1: if len(request.args) < 1:
# q: list all table or keep predefined lists_to_serve? # q: list all table or keep predefined lists_to_serve?
lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password']) lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password'])
@ -36,6 +39,8 @@ def searh():
return "no keyword..." return "no keyword..."
if l_arg != "all" and l_arg not in lists_to_serve: if l_arg != "all" and l_arg not in lists_to_serve:
print("list '" + l_arg + "' does not exist")
print(lists_to_serve)
return "list '" + l_arg + "' does not exist" return "list '" + l_arg + "' does not exist"
if f_arg not in ['content', 'from']: if f_arg not in ['content', 'from']: