diff --git a/apiserver/plane/app/serializers/user.py b/apiserver/plane/app/serializers/user.py index 46ab3c4a4..5381995fd 100644 --- a/apiserver/plane/app/serializers/user.py +++ b/apiserver/plane/app/serializers/user.py @@ -159,10 +159,10 @@ class ChangePasswordSerializer(serializers.Serializer): def validate(self, data): if data.get("old_password") == data.get("new_password"): - raise serializers.ValidationError("New password cannot be same as old password.") + raise serializers.ValidationError({"error": "New password cannot be same as old password."}) if data.get("new_password") != data.get("confirm_password"): - raise serializers.ValidationError("confirm password should be same as the new password.") + raise serializers.ValidationError({"error": "Confirm password should be same as the new password."}) return data diff --git a/apiserver/plane/app/views/auth_extended.py b/apiserver/plane/app/views/auth_extended.py index da3130e64..37c8b3d85 100644 --- a/apiserver/plane/app/views/auth_extended.py +++ b/apiserver/plane/app/views/auth_extended.py @@ -133,7 +133,7 @@ class ChangePasswordEndpoint(BaseAPIView): if serializer.is_valid(): if not user.check_password(serializer.data.get("old_password")): return Response( - {"old_password": ["Wrong password."]}, + {"error": "Old password is not correct"}, status=status.HTTP_400_BAD_REQUEST, ) # set_password also hashes the password that the user will get