From 0db8482873114d74361b9187e7b1745cdecbd980 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 10 Oct 2017 14:18:08 +0800 Subject: [PATCH] Update ldap auth --- apps/users/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/utils.py b/apps/users/utils.py index adda32200..38cb55183 100644 --- a/apps/users/utils.py +++ b/apps/users/utils.py @@ -8,7 +8,7 @@ import uuid from paramiko.rsakey import RSAKey from django.conf import settings from django.contrib.auth.mixins import UserPassesTestMixin -from django.urls import reverse_lazy +from django.contrib.auth import authenticate from django.utils.translation import ugettext as _ from django.core.cache import cache @@ -140,7 +140,7 @@ def check_user_valid(**kwargs): elif not user.is_valid: return None, _('Disabled or expired') - if password and user.password and user.check_password(password): + if password and authenticate(username=username, password=password): return user, '' if public_key and user.public_key: