Commit e7b4d8f5 authored by Benjamin "Ziirish" SANS's avatar Benjamin "Ziirish" SANS
Browse files

syntax

parent b3812436
...@@ -66,7 +66,6 @@ def create_db(myapp, cli=False, unittest=False, create=True): ...@@ -66,7 +66,6 @@ def create_db(myapp, cli=False, unittest=False, create=True):
if myapp.config['WITH_SQL']: if myapp.config['WITH_SQL']:
try: try:
from .ext.sql import db from .ext.sql import db
from .models import test_database
from sqlalchemy.exc import OperationalError from sqlalchemy.exc import OperationalError
from sqlalchemy_utils.functions import database_exists from sqlalchemy_utils.functions import database_exists
myapp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False myapp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
...@@ -131,7 +130,7 @@ def create_db(myapp, cli=False, unittest=False, create=True): ...@@ -131,7 +130,7 @@ def create_db(myapp, cli=False, unittest=False, create=True):
'bui-manage' 'bui-manage'
) )
buimanage = local if os.path.exists(local) \ buimanage = local if os.path.exists(local) \
else 'bui-manage' else 'bui-manage'
cmd = [ cmd = [
buimanage, buimanage,
'-c', '-c',
...@@ -179,6 +178,7 @@ def create_db(myapp, cli=False, unittest=False, create=True): ...@@ -179,6 +178,7 @@ def create_db(myapp, cli=False, unittest=False, create=True):
myapp.logger.critical( myapp.logger.critical(
'Something seems to be wrong with your setup: ' 'Something seems to be wrong with your setup: '
'{}'.format(err) '{}'.format(err)
)
myapp.logger.critical('Disabling SQL support for now.') myapp.logger.critical('Disabling SQL support for now.')
myapp.config['WITH_SQL'] = False myapp.config['WITH_SQL'] = False
...@@ -186,6 +186,7 @@ def create_db(myapp, cli=False, unittest=False, create=True): ...@@ -186,6 +186,7 @@ def create_db(myapp, cli=False, unittest=False, create=True):
# If we are here, it means everything is alright # If we are here, it means everything is alright
return db return db
except ImportError: # pragma: no cover except ImportError: # pragma: no cover
myapp.logger.critical( myapp.logger.critical(
'Unable to load requirements, you may want to run \'pip ' 'Unable to load requirements, you may want to run \'pip '
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment