вернул всё обратно
This commit is contained in:
parent
7d6c91bd24
commit
3949be7303
|
|
@ -60,13 +60,6 @@ class MyUserViewSet(ViewSet):
|
|||
def update_user(self, request):
|
||||
password = request.user.password
|
||||
|
||||
|
||||
if check_password(request.data['password'], password):
|
||||
return Response(
|
||||
{'detail': 'Пароли одинаковые', 'error': {'email': 'Пароли одинаковые'}},
|
||||
status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
if check_password(request.data['old_password'], password):
|
||||
if request.data['password'] == request.data['email']:
|
||||
return Response(
|
||||
{'detail': 'Почта не может являться паролем', 'error': {'email': 'Почта не может являться паролем'}},
|
||||
|
|
@ -77,6 +70,13 @@ class MyUserViewSet(ViewSet):
|
|||
{'detail': 'Минимальная длина - 8 символов', 'error': {'email': 'Минимальная длина - 8 символов'}},
|
||||
status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
if check_password(request.data['password'], password):
|
||||
return Response(
|
||||
{'detail': 'Пароли одинаковые', 'error': {'email': 'Пароли одинаковые'}},
|
||||
status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
if check_password(request.data['old_password'], password):
|
||||
|
||||
if 'email' in request.data:
|
||||
del request.data['email']
|
||||
if 'password' in request.data:
|
||||
|
|
|
|||
Loading…
Reference in New Issue