diff options
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -34,6 +34,15 @@ def ldap_connect(): # we had crap in the session, delete it logout_user() +@app.before_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'): + with open(app.config['USERNAME_BLACKLIST_FILE']) as f: + app.username_blacklist = f.read().split('\n') + @app.route('/', methods=['GET', 'POST']) @templated('index.html') |