diff options
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') |