From 227d26cb9eb8be19512d2cc189d0a6c44569ef42 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 20 Nov 2019 12:31:58 +0100 Subject: [PATCH] fix api config on ci - #15 --- docs/.buildinfo | 2 +- fittrackee_api/server.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/.buildinfo b/docs/.buildinfo index 69f61b10..86ce424f 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 49668bbf739dde28729baae15bc4e905 +config: 30c5e5361bea086cc59c229f2ef9de12 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/fittrackee_api/server.py b/fittrackee_api/server.py index 93686e38..9852fd6b 100644 --- a/fittrackee_api/server.py +++ b/fittrackee_api/server.py @@ -3,7 +3,10 @@ import shutil from fittrackee_api import create_app, db from fittrackee_api.activities.models import Activity, Sport from fittrackee_api.activities.utils import update_activity -from fittrackee_api.application.utils import init_config +from fittrackee_api.application.utils import ( + init_config, + update_app_config_from_database, +) from fittrackee_api.users.models import User from tqdm import tqdm @@ -55,6 +58,10 @@ def initdata(): sport.is_default = True db.session.add(sport) db.session.commit() + # update app config + _, db_app_config = init_config() + update_app_config_from_database(app, db_app_config) + print('Initial data stored in database.')