# HG changeset patch # User Daniele Nicolodi # Date 1318581287 -7200 # Node ID 1944c8ad80cbe49d3a23de404f2d44cdf4f6cd42 # Parent 83e915192078ea9dcf2a6e23304c388d3e479c3e Add missing permission check. diff -r 83e915192078 -r 1944c8ad80cb src/ltpdarepo/views/browse.py --- a/src/ltpdarepo/views/browse.py Fri Oct 14 10:34:47 2011 +0200 +++ b/src/ltpdarepo/views/browse.py Fri Oct 14 10:34:47 2011 +0200 @@ -558,26 +558,27 @@ @app.route('//timeseries') @require('user') def timeseries(database): - db = Database.load(database) - if db is None: - # not found - abort(404) + with view('database', database): + db = Database.load(database) + if db is None: + # not found + abort(404) - # applicable search criteria - indexes = Indexes(database, Timeseries.columns) + # applicable search criteria + indexes = Indexes(database, Timeseries.columns) - # parse reuest - r = Request(request.args, Timeseries.columns, indexes) - t = Timerange(request.args) + # parse reuest + r = Request(request.args, Timeseries.columns, indexes) + t = Timerange(request.args) - # collect objects - count = Timeseries(database).filter(*r.query).timespan(*t.range).count() - batch = Pagination(r.page, size=PAGESIZE, count=count) - objs = Timeseries(database).filter(*r.query).timespan(*t.range).orderby(*r.order).limit(*batch.limits).all() + # collect objects + count = Timeseries(database).filter(*r.query).timespan(*t.range).count() + batch = Pagination(r.page, size=PAGESIZE, count=count) + objs = Timeseries(database).filter(*r.query).timespan(*t.range).orderby(*r.order).limit(*batch.limits).all() - return render_template('timerange.html', objs=objs, batch=batch, - fields=TIMESERIESFIELDS, database=db, - indexes=indexes, query=r.criteria, timerange=t) + return render_template('timerange.html', objs=objs, batch=batch, + fields=TIMESERIESFIELDS, database=db, + indexes=indexes, query=r.criteria, timerange=t) module = app