user_management/api/serializers.py
def update(self, instance, validated_data):
        """Set the new password for the user."""
        instance.set_password(validated_data['new_password'])
        instance.save()
        return instance
def update(self, instance, validated_data):
        """Set the new password for the user."""
        instance.set_password(validated_data['new_password'])
        instance.save()
        return instance
Set the new password for the user.