diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2016-01-24 00:49:33 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2016-02-02 04:22:15 +0100 |
commit | 2c52dbbfecfaee3b08e87b8efc8c09f6021cd696 (patch) | |
tree | ea8c9a5bf030acbd730f62ccfd25eacceda7d440 | |
parent | 30f98433bc39f04bddfb4830d326913faae90549 (diff) | |
download | web-2c52dbbfecfaee3b08e87b8efc8c09f6021cd696.tar.gz web-2c52dbbfecfaee3b08e87b8efc8c09f6021cd696.tar.bz2 web-2c52dbbfecfaee3b08e87b8efc8c09f6021cd696.zip |
Remove context_processor with single use
If we need the variable only in a single view, we can simply supply this
value for this single view.
-rw-r--r-- | accounts/__init__.py | 6 | ||||
-rw-r--r-- | accounts/views/default/__init__.py | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/accounts/__init__.py b/accounts/__init__.py index 35c0475..f5afc47 100644 --- a/accounts/__init__.py +++ b/accounts/__init__.py @@ -46,9 +46,3 @@ def read_blacklist(): if app.config.get('USERNAME_BLACKLIST_FILE'): 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 - } diff --git a/accounts/views/default/__init__.py b/accounts/views/default/__init__.py index e2db8b2..c2099d5 100644 --- a/accounts/views/default/__init__.py +++ b/accounts/views/default/__init__.py @@ -237,7 +237,9 @@ def logout(): @bp.route('/about') @templated('about.html') def about(): - return {} + return { + 'app': current_app, + } @bp.app_errorhandler(403) |