[FIX] add warning when dbfilter logs out current session
bzr revid: xmo@openerp.com-20140203115633-es2o542ywg85d46i
This commit is contained in:
parent
d23f8425ad
commit
0aa0bbd539
|
@ -972,9 +972,12 @@ class Root(object):
|
||||||
def setup_db(self, httprequest):
|
def setup_db(self, httprequest):
|
||||||
db = httprequest.session.db
|
db = httprequest.session.db
|
||||||
# Check if session.db is legit
|
# Check if session.db is legit
|
||||||
if db and db not in db_filter([db], httprequest=httprequest):
|
if db:
|
||||||
httprequest.session.logout()
|
if db not in db_filter([db], httprequest=httprequest):
|
||||||
db = None
|
_logger.warn("Logged into database '%s', but dbfilter "
|
||||||
|
"rejects it; logging session out.", db)
|
||||||
|
httprequest.session.logout()
|
||||||
|
db = None
|
||||||
|
|
||||||
if not db:
|
if not db:
|
||||||
httprequest.session.db = db_monodb(httprequest)
|
httprequest.session.db = db_monodb(httprequest)
|
||||||
|
|
Loading…
Reference in New Issue