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: