Skip to content

Commit

Permalink
Some adjustments for python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
shirlei authored and benadida committed Apr 9, 2023
1 parent 45f4069 commit b1eeb1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions helios_auth/auth_systems/ldapauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def ldap_login_view(request):
password = form.cleaned_data['password'].strip()

auth = backend.CustomLDAPBackend()
if user := auth.authenticate(
None, username=username, password=password
):
user = auth.authenticate( None, username=username, password=password)

if user:
request.session['ldap_user'] = {
'username': user.username,
'email': user.email,
Expand Down
2 changes: 1 addition & 1 deletion helios_auth/auth_systems/ldapbackend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def authenticate_ldap_user(self, username, password):

if user and self.settings.BIND_PASSWORD == '' :
search = self.settings.USER_SEARCH
if search is None:
if not isinstance(search, LDAPSearch):
raise ImproperlyConfigured('AUTH_LDAP_USER_SEARCH must be an LDAPSearch instance.')
results = search.execute(user.ldap_user.connection, {'user': user.username})
if results is not None and len(results) == 1:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ oauth2client==4.1.3
rollbar==0.14.7

#ldap auth
django_auth_ldap==4.1.0
django_auth_ldap==4.0.0
python-ldap==3.4.3

0 comments on commit b1eeb1b

Please sign in to comment.