summaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2016-01-22 17:26:00 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2016-01-22 17:26:26 +0100
commit5fde298d4b705bd256d5510493955ca98a31acdc (patch)
tree15d8cb83e531778ce865deca52a4ce123bf0c19f /app.py
parent41a881815fe7c8d8e236f8146b9434b51af75ecc (diff)
downloadweb-5fde298d4b705bd256d5510493955ca98a31acdc.tar.gz
web-5fde298d4b705bd256d5510493955ca98a31acdc.tar.bz2
web-5fde298d4b705bd256d5510493955ca98a31acdc.zip
Bump flask version
Diffstat (limited to 'app.py')
-rw-r--r--app.py11
1 files changed, 3 insertions, 8 deletions
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')