diff --git a/flask_simpleldap/__init__.py b/flask_simpleldap/__init__.py index b8110a8d9fee43ae9867ca8ac0e4984422779d2e..2e067e161f25a6ecc9fa5ede6bc527dd2f7b0b64 100644 --- a/flask_simpleldap/__init__.py +++ b/flask_simpleldap/__init__.py @@ -76,6 +76,9 @@ class LDAP(object): if app.config['LDAP_{0}'.format(option)] is None: raise LDAPException('LDAP_{0} cannot be None!'.format(option)) + # Bind LDAP to app + app.ldap = self + @staticmethod def _set_custom_options(conn): options = current_app.config['LDAP_CUSTOM_OPTIONS']