Fixing theme switching (#277)

Something in Flask 0.12 changed the behavior of Jinja templates. There
are a couple open issues about it
https://github.com/pallets/flask/issues/1907
This commit is contained in:
Kevin Chung
2017-06-10 14:01:32 -04:00
committed by GitHub
parent 4fedc8f69e
commit 5fc6c59245
2 changed files with 5 additions and 1 deletions

View File

@@ -37,7 +37,7 @@ class Pages(db.Model):
self.html = html
def __repr__(self):
return "<Pages {0} for challenge {1}>".format(self.tag, self.chal)
return "<Pages route {0}>".format(self.route)
class Containers(db.Model):

View File

@@ -144,6 +144,10 @@ def init_utils(app):
if session['nonce'] != request.form.get('nonce'):
abort(403)
@app.before_request
def disable_jinja_cache():
app.jinja_env.cache = {}
@cache.memoize()
def ctf_name():