summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app.py6
-rw-r--r--utils.py6
2 files changed, 7 insertions, 5 deletions
diff --git a/app.py b/app.py
index 4c93ccf..f06eb0b 100644
--- a/app.py
+++ b/app.py
@@ -43,6 +43,12 @@ def read_blacklist():
with open(app.config['USERNAME_BLACKLIST_FILE']) as f:
app.username_blacklist = f.read().split('\n')
+@app.context_processor
+def template_default_context():
+ return {
+ 'app': app
+ }
+
@app.route('/', methods=['GET', 'POST'])
@templated('index.html')
diff --git a/utils.py b/utils.py
index 2cd30dc..27dfb33 100644
--- a/utils.py
+++ b/utils.py
@@ -28,11 +28,7 @@ def templated(template=None):
if template_name is None:
template_name = request.endpoint \
.replace('.', '/') + '.html'
-
- ctx = {
- 'app': current_app,
- }
- ctx.update(f(*args, **kwargs))
+ ctx = f(*args, **kwargs)
if ctx is None:
ctx = {}
elif not isinstance(ctx, dict):