utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:basket 作者: mozmeao 项目源码 文件源码
def process_email(email):
    """Validates that the email is valid.

    Return email ascii encoded if valid, None if not.
    """
    if not email:
        return None

    email = force_unicode(email)
    try:
        # NOTE SFDC doesn't support SMPTUTF8, so we cannot enable support
        #      here until they do or we switch providers
        info = validate_email(email, allow_smtputf8=False,
                              check_deliverability=False)
    except EmailNotValidError:
        return None

    return info.get('email_ascii', None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号