Commit 882c6129 authored by Grégory Wisniewski's avatar Grégory Wisniewski

If no database adapter is given, choose the first one.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1388 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 1f307db2
...@@ -24,6 +24,8 @@ DATABASE_MANAGER_DICT = { ...@@ -24,6 +24,8 @@ DATABASE_MANAGER_DICT = {
} }
def buildDatabaseManager(name, config): def buildDatabaseManager(name, config):
if name is None:
name = DATABASE_MANAGER_DICT.keys()[0]
adapter_klass = DATABASE_MANAGER_DICT.get(name, None) adapter_klass = DATABASE_MANAGER_DICT.get(name, None)
if adapter_klass is None: if adapter_klass is None:
raise DatabaseFailure('Cannot find a database adapter <%s>' % name) raise DatabaseFailure('Cannot find a database adapter <%s>' % name)
......
Markdown is supported
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