diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2016-01-22 17:26:00 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2016-01-22 17:26:26 +0100 |
commit | 5fde298d4b705bd256d5510493955ca98a31acdc (patch) | |
tree | 15d8cb83e531778ce865deca52a4ce123bf0c19f /app.py | |
parent | 41a881815fe7c8d8e236f8146b9434b51af75ecc (diff) | |
download | web-5fde298d4b705bd256d5510493955ca98a31acdc.tar.gz web-5fde298d4b705bd256d5510493955ca98a31acdc.tar.bz2 web-5fde298d4b705bd256d5510493955ca98a31acdc.zip |
Bump flask version
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -1,8 +1,5 @@ # -*- coding: utf-8 -*- -import flaskext_compat -flaskext_compat.activate() - import account import ldap import os @@ -20,6 +17,7 @@ if 'SPLINE_ACCOUNT_WEB_SETTINGS' in os.environ: app.config.from_envvar('SPLINE_ACCOUNT_WEB_SETTINGS') app.all_services = account.SERVICES #TODO: take that from our json file or so +app.username_blacklist = list() @app.before_request def session_permanent(): @@ -46,12 +44,9 @@ def initialize_user(): # we had crap in the session, delete it logout_user() -@app.before_request +@app.before_first_request def read_blacklist(): - app.username_blacklist = None - - # use @before_first_request as soon as we require flask 0.8 - if app.username_blacklist is None and app.config.get('USERNAME_BLACKLIST_FILE'): + if app.config.get('USERNAME_BLACKLIST_FILE'): with open(app.config['USERNAME_BLACKLIST_FILE']) as f: app.username_blacklist = f.read().split('\n') |