Commit 3a373f72 authored by Julian Rother's avatar Julian Rother
Browse files

Ensure the error page query does not raise more errors

parent 761a55d8
......@@ -177,7 +177,7 @@ def handle_not_found(e):
@app.errorhandler(Exception)
def handle_internal_error(e):
traceback.print_exc()
return render_template('500.html')
return render_template('500.html'), 500
@sched_func(5*60, firstdelay=0)
def dump_error_page():
......@@ -227,7 +227,10 @@ def get_announcements(minlevel=0):
offset = timedelta()
if ismod():
offset = timedelta(hours=24)
return query('SELECT * FROM announcements WHERE NOT deleted AND ((time_expire = NULL) OR time_expire > ?) AND (? OR (visible AND time_publish < ?)) AND level >= ? ORDER BY level DESC', datetime.now()-offset, ismod(), datetime.now(), minlevel)
try:
return query('SELECT * FROM announcements WHERE NOT deleted AND ((time_expire = NULL) OR time_expire > ?) AND (? OR (visible AND time_publish < ?)) AND level >= ? ORDER BY level DESC', datetime.now()-offset, ismod(), datetime.now(), minlevel)
except:
return []
@app.template_filter()
def fixnl(s):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment