def METHOD_NAME(username):
    """更新用户ding_user_id"""
    try:
        ding_user_id = rs.execute_command("GET {}".format(username.lower()))
        if ding_user_id:
            user = Users.objects.get(username=username)
            if user.ding_user_id != str(ding_user_id, encoding="utf8"):
                user.ding_user_id = str(ding_user_id, encoding="utf8")
                user.save(update_fields=["ding_user_id"])
    except Exception as e:
        logger.error(f"更新用户ding_user_id失败:{e}")