psa-allauth
psa-allauth copied to clipboard
'User' object has no attribute 'validate_password'
From documentation http://psa.matiasaguirre.net/docs/backends/email.html there is a suggestion how to validate a password like below:
def user_password(strategy, user, is_new=False, *args, **kwargs):
if strategy.backend.name != 'email':
return
password = strategy.request_data()['password']
if is_new:
user.set_password(password)
user.save()
elif not user.validate_password(password):
# return {'user': None, 'social': None}
raise AuthException(strategy.backend)
When I try to utilize code
user.validate_password(password):
I get an error:
AttributeError at /complete/email/
'User' object has no attribute 'validate_password'
Any suggestion on this issue?