diff --git a/openerp/http.py b/openerp/http.py index d70e5358ed9..c63a795b6a7 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -1224,10 +1224,11 @@ class Root(object): try: with openerp.tools.mute_logger('openerp.sql_db'): ir_http = request.registry['ir.http'] - except psycopg2.OperationalError: - # psycopg2 error. At this point, that means the - # database probably does not exists anymore. Log the - # user out and fall back to nodb + except (AttributeError, psycopg2.OperationalError): + # 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. + # Log the user out and fall back to nodb request.session.logout() result = _dispatch_nodb() else: