Exemplo n.º 1
0
    def __before__(self, action, **env):
        try:
            BaseController.__before__(self, action, **env)

            self._ngds_deployment()
        except (sqlalchemy.exc.ProgrammingError,
                sqlalchemy.exc.OperationalError), e:
            # postgres and sqlite errors for missing tables
            msg = str(e)
            if ('relation' in msg and 'does not exist' in msg) or \
                    ('no such table' in msg):
                # table missing, major database problem
                abort(503, _('This site is currently off-line. Database is not initialised.'))
            else:
                raise
Exemplo n.º 2
0
 def __before__(self, action, **env):
     try:
         BaseController.__before__(self, action, **env)
     except NotAuthorized:
         abort(401, _('Not authorized to see this page'))
     except (sqlalchemy.exc.ProgrammingError,
             sqlalchemy.exc.OperationalError), e:
         # postgres and sqlite errors for missing tables
         msg = str(e)
         if ('relation' in msg and 'does not exist' in msg) or \
                ('no such table' in msg) :
             # table missing, major database problem
             abort(503, _('This site is currently off-line. Database is not initialised.'))
             # TODO: send an email to the admin person (#1285)
         else:
             raise
Exemplo n.º 3
0
    def __before__(self, action, **env):
        try:
            BaseController.__before__(self, action, **env)

            self._ngds_deployment()
        except (sqlalchemy.exc.ProgrammingError,
                sqlalchemy.exc.OperationalError), e:
            # postgres and sqlite errors for missing tables
            msg = str(e)
            if ('relation' in msg and 'does not exist' in msg) or \
                    ('no such table' in msg):
                # table missing, major database problem
                abort(
                    503,
                    _('This site is currently off-line. Database is not initialised.'
                      ))
            else:
                raise
Exemplo n.º 4
0
 def __before__(self, action, **env):
     try:
         BaseController.__before__(self, action, **env)
     except NotAuthorized:
         abort(401, _('Not authorized to see this page'))
     except (sqlalchemy.exc.ProgrammingError,
             sqlalchemy.exc.OperationalError), e:
         # postgres and sqlite errors for missing tables
         msg = str(e)
         if ('relation' in msg and 'does not exist' in msg) or \
                ('no such table' in msg) :
             # table missing, major database problem
             abort(
                 503,
                 _('This site is currently off-line. Database is not initialised.'
                   ))
             # TODO: send an email to the admin person (#1285)
         else:
             raise