Beispiel #1
0
def is_place_taken(form, field):
    """Check if the given place for given collection is already taken.

    :param form: the form containing the validated field
    :param field: the validated field
    """
    order = field.data
    collection = form.data['collection']
    if not collection:
        return

    if FacetCollection.is_place_taken(collection.id, order):
        raise ValidationError('A facet on the given place already exists')
Beispiel #2
0
def is_place_taken(form, field):
    """Check if the given place for given collection is already taken.

    :param form: the form containing the validated field
    :param field: the validated field
    """
    order = field.data
    collection = form.data['collection']
    if not collection:
        return

    if FacetCollection.is_place_taken(collection.id, order):
        raise ValidationError('A facet on the given place already exists')