djoser
djoser copied to clipboard
USER_CREATE_PASSWORD_RETYPE False throws an AttributeError
Issues with Djoser 2.1.0
Here's my configuration in the settings.py
DJOSER = {
'LOGIN_FIELD': 'email',
'USER_CREATE_PASSWORD_RETYPE': False,
'SERIALIZERS': {
'user_create': 'accounts.serializers.UserCreateSerializer',
'user': 'accounts.serializers.UserSerializer',
'user_delete': 'djoser.serializers.UserDeleteSerializer',
}
}
Endpoint URL :
http://localhost:8000/api/auth/users/
which in the urls settings i've included
path('api/auth/', include('djoser.urls')),
The Post Body request
{
"id": 1,
"role": "Admin",
"email": "[email protected]",
"password": "helloworld214",
"name": "Aranmu Haesulla"
}
Error logs
File "..../env/lib/python3.9/site-packages/django/contrib/auth/password_validation.py", line 145, in validate if SequenceMatcher(a=password.lower(), b=value_part.lower()).quick_ratio() >= self.max_similarity: AttributeError: 'NoneType' object has no attribute 'lower'
when I changed the 'USER_CREATE_PASSWORD_RETYPE': True,
it throws a success
Facing the same issue too
same issue