From 5fde298d4b705bd256d5510493955ca98a31acdc Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 22 Jan 2016 17:26:00 +0100 Subject: Bump flask version --- app.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'app.py') diff --git a/app.py b/app.py index 15434bf..c29054c 100644 --- a/app.py +++ b/app.py @@ -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') -- cgit v1.2.3-1-g7c22