diff --git a/www/routes.py b/www/routes.py index a68b2a5..5cf5ea5 100644 --- a/www/routes.py +++ b/www/routes.py @@ -5,6 +5,7 @@ import config from datetime import datetime import os, logging +lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password']) @app.route('/') def index(): @@ -22,6 +23,8 @@ def lists(): @app.route('/search') def searh(): + + global lists_to_serve if len(request.args) < 1: # q: list all table or keep predefined lists_to_serve? @@ -36,6 +39,8 @@ def searh(): return "no keyword..." 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" if f_arg not in ['content', 'from']: