Exemplo n.º 1
0
def user_exists(form, field):
    if count_user_by_pseudo(field.data) == 0:
        raise ValidationError("Does not exists.")
Exemplo n.º 2
0
def unique_user(form, field):
    """
    Check if user's pseudo is not already used.
    """
    if count_user_by_pseudo(field.data) > 0:
        raise ValidationError("Pseudo unavailable.")