mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-23 15:14:49 +01:00
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:
@@ -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):
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user