Esempio n. 1
0
def plugin_configuration(db):
    plugin_configuration = PluginConfiguration.objects.create(
        **AvataxPlugin._get_default_configuration()
    )
    config = [
        {"name": "Username or account", "value": "2000134479"},
        {"name": "Password or license", "value": "697932CFCBDE505B"},
    ]
    AvataxPlugin._update_config_items(config, plugin_configuration.configuration)
    plugin_configuration.active = True
    plugin_configuration.save()
    return plugin_configuration
Esempio n. 2
0
def plugin_configuration(db):
    default_configuration = AvataxPlugin._get_default_configuration()
    for elem in default_configuration["configuration"]:
        if elem["name"] == "Use sandbox":
            elem["value"] = False
    plugin_configuration = PluginConfiguration.objects.create(
        **default_configuration)
    config = [
        {
            "name": "Username or account",
            "value": "2000134479"
        },
        {
            "name": "Password or license",
            "value": "697932CFCBDE505B"
        },
    ]
    AvataxPlugin._update_config_items(config,
                                      plugin_configuration.configuration)
    plugin_configuration.active = True
    plugin_configuration.save()
    return plugin_configuration