Remove unnecessary calls to the database for user and permission metadata.

This commit is contained in:
yackob03 2013-10-15 14:48:49 -04:00
parent 13298be5d3
commit 959016a6eb
5 changed files with 58 additions and 39 deletions

View file

@ -14,18 +14,12 @@ db = app.config['DB_DRIVER'](app.config['DB_NAME'],
**app.config['DB_CONNECTION_ARGS'])
def connect_db():
logger.debug('Connectin to database.')
db.connect()
def close_db(exc):
if not db.is_closed():
logger.debug('Disconnecting from database.')
db.close()
app.before_request(connect_db)
app.teardown_request(close_db)