(domain)
return settings
Only creates settings if the domain has the DEFAULT_EXPORT_SETTINGS privilege
Only creates settings if the domain has the DEFAULT_EXPORT_SETTINGS privilege
Only creates settings if the domain has the DEFAULT_EXPORT_SETTINGS privilege
def get_default_export_settings_if_available(domain):
    """
    Only creates settings if the domain has the DEFAULT_EXPORT_SETTINGS privilege
    """
    settings = None
    current_subscription = Subscription.get_active_subscription_by_domain(domain)
    if current_subscription and domain_has_privilege(domain, DEFAULT_EXPORT_SETTINGS):
        from corehq.apps.export.models import DefaultExportSettings
        settings = DefaultExportSettings.objects.get_or_create(account=current_subscription.account)[0]

    return settings
def get_default_export_settings_if_available ( domain ) : settings = None current_subscription = Subscription . get_active_subscription_by_domain ( domain ) if current_subscription and domain_has_privilege ( domain , DEFAULT_EXPORT_SETTINGS ) : from corehq . apps . export . models import DefaultExportSettings settings = DefaultExportSettings . objects . get_or_create ( account = current_subscription . account ) [ 0 ] return settings