def validate_batch(ctx, param, value):
    if value != app.config['DEFAULT_BATCH'] and \
            value in Batch.objects.scalar('id'):
        raise click.BadParameter(
            'Batch with id {id} already exists'.format(id=value))
    else:
        return value
Refuses your attempts to add tasks to existing batch (except 'default')
dataset/ETHPy150Open mrgambal/vulyk/vulyk/cli/batches.py/validate_batch