Refactor connection setup and enhance view initialization with session management

1 parent 61e40e7b
......@@ -286,7 +286,7 @@ class Targets(PCBase, DefaultModel):
def get_connection(settings):
url = 'pcpd.url' in settings and settings['pcpd.url'] and 'pcpd.' or 'sqlalchemy.'
engine = engine_from_config(settings, url, pool_pre_ping=True)
engine = engine_from_config(settings, url)
PCDBSession.configure(bind=engine)
PCBase.metadata.bind = engine
return engine
......@@ -294,7 +294,6 @@ def get_connection(settings):
def includeme(config):
settings = get_settings()
get_connection(settings)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!