fix issues #20 and #29: init the db after registering all the routes

This commit is contained in:
nobohan 2022-04-14 15:50:49 +02:00
parent 44c937275a
commit 2e0c7e897e
1 changed files with 3 additions and 4 deletions

View File

@ -92,9 +92,6 @@ def get_app(config, _app=None, with_external_mods=True, url_prefix="/api"):
with app.app_context():
create_schemas(db)
db.create_all()
populate_modules(db)
from gncitizen.core.users.routes import users_api
from gncitizen.core.commons.routes import commons_api
@ -136,6 +133,8 @@ def get_app(config, _app=None, with_external_mods=True, url_prefix="/api"):
# _app = app
create_schemas(db)
db.create_all()
populate_modules(db)
return app