djoser icon indicating copy to clipboard operation
djoser copied to clipboard

USER_CREATE_PASSWORD_RETYPE False throws an AttributeError

Open fonmagnus opened this issue 3 years ago • 2 comments

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

fonmagnus avatar Apr 15 '21 01:04 fonmagnus

Facing the same issue too

mhasan09 avatar May 03 '22 19:05 mhasan09

same issue

thumbaround avatar Aug 07 '23 05:08 thumbaround