def METHOD_NAME(form, basket):
    """
    This function updates the products on the form based on the current capacity
    so it will fail to validate if the requested ticket capacity is now unavailable.
    """
    # Whether submitted or not, update the allowed amounts before validating
    capacity_available = True
    for f in form.tiers:
        pt_id = f.tier_id.data
        tier = form._tiers[pt_id]
        f._tier = tier
        # If they've already got reserved tickets, they can keep them
        # because they've been reserved in the database
        user_limit = max(tier.user_limit(), basket.get(tier, 0))
        if f.amount.data and f.amount.data > user_limit:
            f.amount.data = user_limit
            capacity_available = False
        values = range(user_limit + 1)
        f.amount.values = values
        f._any = any(values)
    return capacity_available