def week(wk): try: worst = db.get_worst(wk) except: worst = {} finally: return render_template("index.html", worst=worst)
def index(): latest = [w for w in db.available_weeks()][-1] worst = db.get_worst(latest) return render_template("index.html", worst=worst)