[FIX] drop database fails when done before connecting to server.
lp bug: https://launchpad.net/bugs/924783 fixed bzr revid: ronald@therp.nl-20120201113759-wi2kogl2x1lsxk7g
This commit is contained in:
parent
ac205cd443
commit
64773ba357
|
@ -21,3 +21,5 @@ bin/pil*.py
|
||||||
.project
|
.project
|
||||||
.pydevproject
|
.pydevproject
|
||||||
.settings
|
.settings
|
||||||
|
profiledata
|
||||||
|
*.moved
|
||||||
|
|
|
@ -509,8 +509,10 @@ def db_connect(db_name):
|
||||||
return Connection(_Pool, db_name)
|
return Connection(_Pool, db_name)
|
||||||
|
|
||||||
def close_db(db_name):
|
def close_db(db_name):
|
||||||
|
global _Pool
|
||||||
""" You might want to call openerp.modules.registry.RegistryManager.delete(db_name) along this function."""
|
""" You might want to call openerp.modules.registry.RegistryManager.delete(db_name) along this function."""
|
||||||
_Pool.close_all(dsn(db_name))
|
if _Pool:
|
||||||
|
_Pool.close_all(dsn(db_name))
|
||||||
ct = currentThread()
|
ct = currentThread()
|
||||||
if hasattr(ct, 'dbname'):
|
if hasattr(ct, 'dbname'):
|
||||||
delattr(ct, 'dbname')
|
delattr(ct, 'dbname')
|
||||||
|
|
Loading…
Reference in New Issue