Beispiel #1
0
def user_exists(form, field):
    '''check if user exists, if it does raise error'''
    if Classmate.select().where(Classmate.username == field.data).exists():
        raise ValidationError('User with that name already exists.')
Beispiel #2
0
def email_exists(form, field):
    '''check if email exists, if it does raise error'''
    if Classmate.select().where(Classmate.email == field.data).exists():
        raise ValidationError('User with that email already exists.')