(edition, verbose, apps)
return features
Ensures that all the Features necessary for the plans are created.
Ensures that all the Features necessary for the plans are created.
Ensures that all the Features necessary for the plans are created .
def _ensure_features(edition, verbose, apps):
    """
    Ensures that all the Features necessary for the plans are created.
    """
    Feature = apps.get_model('accounting', 'Feature')

    if verbose:
        log_accounting_info('Ensuring Features for plan: %s' % edition)

    features = []
    for feature_type in FEATURE_TYPES:
        feature = Feature(name='%s %s' % (feature_type, edition), feature_type=feature_type)
        if edition == SoftwarePlanEdition.ENTERPRISE:
            feature.name = "Dimagi Only %s" % feature.name
        try:
            feature = Feature.objects.get(name=feature.name)
            if verbose:
                log_accounting_info(
                    "Feature '%s' already exists. Using existing feature to add rate."
                    % feature.name
                )
        except Feature.DoesNotExist:
            feature.save()
            if verbose:
                log_accounting_info("Creating Feature: %s" % feature)
        features.append(feature)
    return features
def _ensure_features ( edition , verbose , apps ) : Feature = apps . get_model ( 'accounting' , 'Feature' ) if verbose : log_accounting_info ( 'Ensuring Features for plan: %s' % edition ) features = [ ] for feature_type in FEATURE_TYPES : feature = Feature ( name = '%s %s' % ( feature_type , edition ) , feature_type = feature_type ) if edition == SoftwarePlanEdition . ENTERPRISE : feature . name = "Dimagi Only %s" % feature . name try : feature = Feature . objects . get ( name = feature . name ) if verbose : log_accounting_info ( "Feature '%s' already exists. Using existing feature to add rate." % feature . name ) except Feature . DoesNotExist : feature . save ( ) if verbose : log_accounting_info ( "Creating Feature: %s" % feature ) features . append ( feature ) return features