[FIX] http jump to database selector on broken databases
This commit is contained in:
+10
-4
@@ -1444,13 +1444,19 @@ class Root(object):
|
||||
try:
|
||||
with openerp.tools.mute_logger('openerp.sql_db'):
|
||||
ir_http = request.registry['ir.http']
|
||||
except (AttributeError, psycopg2.OperationalError):
|
||||
except (AttributeError, psycopg2.OperationalError, psycopg2.ProgrammingError):
|
||||
# psycopg2 error or attribute error while constructing
|
||||
# the registry. That means the database probably does
|
||||
# not exists anymore or the code doesnt match the db.
|
||||
# the registry. That means either
|
||||
# - the database probably does not exists anymore
|
||||
# - the database is corrupted
|
||||
# - the database version doesnt match the server version
|
||||
# Log the user out and fall back to nodb
|
||||
request.session.logout()
|
||||
result = _dispatch_nodb()
|
||||
# If requesting /web this will loop
|
||||
if request.httprequest.path == '/web':
|
||||
result = werkzeug.utils.redirect('/web/database/selector')
|
||||
else:
|
||||
result = _dispatch_nodb()
|
||||
else:
|
||||
result = ir_http._dispatch()
|
||||
openerp.modules.registry.RegistryManager.signal_caches_change(db)
|
||||
|
||||
Reference in New Issue
Block a user