From d5a8c3a777445b67f1fc46d4fa4e41133b3f26e1 Mon Sep 17 00:00:00 2001 From: Tharre Date: Wed, 30 Aug 2017 23:03:57 +0200 Subject: Run init_db() at the start, not in init_db() --- app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 410ad0d..955d1a8 100755 --- a/app.py +++ b/app.py @@ -14,10 +14,10 @@ DATABASE = 'db.sqlite3' cache = SimpleCache() -def init_db(): - if not os.path.isfile(DATABASE): - init_db() +if not os.path.isfile(DATABASE): + init_db() +def init_db(): with app.app_context(): db = get_db() with app.open_resource('schema.sql', mode='r') as f: -- cgit v1.2.3-70-g09d2