From: Christopher Allan Webber Date: Sun, 30 Nov 2014 19:53:21 +0000 (-0600) Subject: Return DatabaseManager or DatabaseMaster depending on DISABLE_GLOBALS X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=63f6a418d1333e15522ec00be13d1525b68f36f5;p=mediagoblin.git Return DatabaseManager or DatabaseMaster depending on DISABLE_GLOBALS They're both similar! One sets up sessions, one grabs sessions from a global object. --- diff --git a/mediagoblin/db/open.py b/mediagoblin/db/open.py index 4b4dfa12..9922cc10 100644 --- a/mediagoblin/db/open.py +++ b/mediagoblin/db/open.py @@ -142,9 +142,13 @@ def setup_connection_and_db_from_config(app_config, migrations=False): # logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) - Session.configure(bind=engine) + if DISABLE_GLOBALS: + return DatabaseManager(engine) - return DatabaseMaster(engine) + else: + Session.configure(bind=engine) + + return DatabaseMaster(engine) def check_db_migrations_current(db):