From 2b68b55c5293c27a53ff840be5186ef86a5ff801 Mon Sep 17 00:00:00 2001 From: Alexander PapaTutuWawa Date: Fri, 5 Feb 2021 17:00:55 +0100 Subject: [PATCH] Format using Black --- myauth/ldap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/myauth/ldap.py b/myauth/ldap.py index a96860d..96bc404 100644 --- a/myauth/ldap.py +++ b/myauth/ldap.py @@ -13,6 +13,7 @@ import ldap User = get_typed_user_model() + def ldap_setting(name, default): """Wrapper around django.conf.settings""" return getattr(settings, f"LDAP_{name}", default) @@ -78,10 +79,12 @@ class LDAPConnection: return True return False + def is_user_in_ldap(user: UserType = Depends(get_authenticated_user)): if not LDAPConnection.get_instance().has_user(user.username): raise PermissionDenied(detail="User not in LDAP directory.") + def create_user(context: CallbackContext, *args, **kwargs): """ A create_user function which first checks if the user already exists in the