示例#1
0
文件: utils.py 项目: dkofiarmah/memba
def validate_email(s, quiet=True):
    try:
        _validate_email(s)
        return True
    except Exception, e:
        if not quiet:
            raise e
示例#2
0
文件: utils.py 项目: a2call/tendenci
def validate_email(s, quiet=True):
    try:
        _validate_email(s)
        return True
    except Exception, e:
        if not quiet:
            raise e
示例#3
0
def validate_email(s, quiet=True):
    try:
        _validate_email(s)
        return is_valid_domain(s)
    except Exception as e:
        if not quiet:
            raise e
    return False
示例#4
0
文件: utils.py 项目: goetzk/tendenci
def validate_email(s, quiet=True):
    try:
        _validate_email(s)
        return is_valid_domain(s)
    except Exception as e:
        if not quiet:
            raise e
    return False
def validate_email(email, user=None):
    """Require unique email address"""
    try:
        _validate_email(email)
    except ValidationError:
        raise ValidationError('You must enter a valid email address',
                              code='email_invalid')

    try:
        User.objects.get(Q(username=email) | Q(email=email))
        raise ValidationError('A user with this email address already exists',
                              code='email_duplicate')
    except User.DoesNotExist:
        pass

    try:
        UserEmail.objects.get(email=email)
        raise ValidationError('A user with this email address already exists',
                              code='email_duplicate')
    except UserEmail.DoesNotExist:
        pass
示例#6
0
def validate_email(email):
    try:
        _validate_email(email)
        return True
    except ValidationError:
        return False
示例#7
0
def validate_email(email):
    try:
        _validate_email(email)
        return True
    except ValidationError:
        return False