# HG changeset patch # User Daniele Nicolodi # Date 1313944549 -7200 # Node ID 84672a6ac38b2c919604187d674ec14698ce4c69 # Parent cd4a15072c9739b72d733cf5b6105f52c14ad7d9 Better implement and enable database schema version check. diff -r cd4a15072c97 -r 84672a6ac38b src/ltpdarepo/__init__.py --- a/src/ltpdarepo/__init__.py Sun Aug 21 18:17:27 2011 +0200 +++ b/src/ltpdarepo/__init__.py Sun Aug 21 18:35:49 2011 +0200 @@ -30,8 +30,11 @@ curs = g.db.cursor() curs.execute("SELECT value+0 FROM options WHERE name='version'") g.schema = curs.fetchone()[0] - #if g.schema != SCHEMA and '/static/' not in request.url: - # return render_template('error.html', error=u'500: Needs upgrade'), 500 + if g.schema != SCHEMA and '/static/' not in request.url: + raise InternalServerError( + '

The database needs to be upgraded.

' + 'Current database schema version: %s. ' + 'Required version: %s.

' % (g.schema, SCHEMA)) @app.teardown_request