Exemplo n.º 1
0
def migration_task():
    for config in EWSGhanaConfig.get_all_steady_sync_configs():
        if config.enabled:
            endpoint = GhanaEndpoint.from_config(config)
            ews_bootstrap_domain(EWSApi(config.domain, endpoint))
            stock_data_task.delay(
                EWSStockDataSynchronization(config.domain, endpoint))
Exemplo n.º 2
0
def migration_task():
    for config in EWSGhanaConfig.get_all_steady_sync_configs():
        if config.enabled:
            endpoint = GhanaEndpoint.from_config(config)
            ews_bootstrap_domain(EWSApi(config.domain, endpoint))
            apis = (
                ('stock_transaction', sync_stock_transactions),
            )
            stock_data_task.delay(config.domain, endpoint, apis, config, EWS_FACILITIES)
Exemplo n.º 3
0
def ews_sync_stock_data(request, domain):
    apis = (
        ('stock_transaction', sync_stock_transactions),
    )
    config = EWSGhanaConfig.for_domain(domain)
    domain = config.domain
    endpoint = GhanaEndpoint.from_config(config)
    stock_data_task.delay(domain, endpoint, apis, config, EWS_FACILITIES)
    return HttpResponse('OK')
Exemplo n.º 4
0
def ews_stock_data_task(domain):
    ewsghana_config = EWSGhanaConfig.for_domain(domain)
    domain = ewsghana_config.domain
    endpoint = GhanaEndpoint.from_config(ewsghana_config)
    commtrack_settings_sync(domain, LOCATION_TYPES)
    for product in endpoint.get_products():
        sync_ilsgateway_product(domain, product)
    get_locations(domain, endpoint, EWS_FACILITIES)
    get_product_stock(domain, endpoint, EWS_FACILITIES)
    get_stock_transaction(domain, endpoint, EWS_FACILITIES)
Exemplo n.º 5
0
def fix_users_with_more_than_one_phone_number(domain):
    config = EWSGhanaConfig.for_domain(domain)
    endpoint = GhanaEndpoint.from_config(config)
    ews_api = EWSApi(domain, endpoint)

    offset = 0
    _, smsusers = endpoint.get_smsusers(filters={'with_more_than_one_number': True})
    while smsusers:
        for sms_user in smsusers:
            ews_api.sms_user_sync(sms_user)
        offset += 100
        _, smsusers = endpoint.get_smsusers(filters={'with_more_than_one_number': True}, offset=offset)
Exemplo n.º 6
0
def migrate_email_settings(domain):
    config = EWSGhanaConfig.for_domain(domain)
    endpoint = GhanaEndpoint.from_config(config)
    migrate_email = EmailSettingsSync(domain)

    for report in endpoint.get_daily_reports()[1]:
        migrate_email.daily_report_sync(report)

    for report in endpoint.get_weekly_reports()[1]:
        migrate_email.weekly_report_sync(report)

    for report in endpoint.get_monthly_reports()[1]:
        migrate_email.monthly_report_sync(report)
Exemplo n.º 7
0
def ews_bootstrap_domain_task(domain):
    ews_config = EWSGhanaConfig.for_domain(domain)
    commtrack_settings_sync(domain, LOCATION_TYPES)
    return bootstrap_domain(ews_config, GhanaEndpoint.from_config(ews_config), EXTENSIONS, fetch_groups=False)
Exemplo n.º 8
0
def ews_bootstrap_domain_task(domain):
    ews_config = EWSGhanaConfig.for_domain(domain)
    return bootstrap_domain(EWSApi(domain, GhanaEndpoint.from_config(ews_config)))
Exemplo n.º 9
0
 def endpoint(self):
     return GhanaEndpoint.from_config(EWSGhanaConfig.for_domain(self.domain))
Exemplo n.º 10
0
def balance_migration_task(domain):
    endpoint = GhanaEndpoint.from_config(EWSGhanaConfig.for_domain(domain))
    BalanceMigration(domain, endpoint).balance_email_reports()
Exemplo n.º 11
0
def ews_fix_sms_users(request, domain):
    config = EWSGhanaConfig.for_domain(domain)
    endpoint = GhanaEndpoint.from_config(config)
    sms_users_fix.delay(EWSApi(domain=domain, endpoint=endpoint))
    return HttpResponse('OK')
Exemplo n.º 12
0
def ews_add_products_to_locs(request, domain):
    config = EWSGhanaConfig.for_domain(domain)
    endpoint = GhanaEndpoint.from_config(config)
    add_products_to_loc.delay(EWSApi(domain=domain, endpoint=endpoint))
    return HttpResponse('OK')
Exemplo n.º 13
0
def ews_sync_stock_data(request, domain):
    config = EWSGhanaConfig.for_domain(domain)
    domain = config.domain
    endpoint = GhanaEndpoint.from_config(config)
    stock_data_task.delay(EWSStockDataSynchronization(domain, endpoint))
    return HttpResponse('OK')
Exemplo n.º 14
0
def ews_sync_stock_data(request, domain):
    config = EWSGhanaConfig.for_domain(domain)
    domain = config.domain
    endpoint = GhanaEndpoint.from_config(config)
    stock_data_task.delay(EWSStockDataSynchronization(domain, endpoint))
    return HttpResponse('OK')
Exemplo n.º 15
0
def migration_task():
    for config in EWSGhanaConfig.get_all_steady_sync_configs():
        if config.enabled:
            endpoint = GhanaEndpoint.from_config(config)
            ews_bootstrap_domain(EWSApi(config.domain, endpoint))
            stock_data_task.delay(EWSStockDataSynchronization(config.domain, endpoint))
Exemplo n.º 16
0
def migration_task():
    configs = EWSGhanaConfig.get_all_configs()
    for config in configs:
        if config.enabled:
            ews_bootstrap_domain(EWSApi(config.domain, GhanaEndpoint.from_config(config)))
Exemplo n.º 17
0
def migration_task():
    configs = EWSGhanaConfig.get_all_configs()
    for config in configs:
        if config.enabled:
            commtrack_settings_sync(config.domain, LOCATION_TYPES)
            ils_bootstrap_domain(config, GhanaEndpoint.from_config(config), EXTENSIONS)
Exemplo n.º 18
0
def ews_bootstrap_domain_task(domain):
    ews_config = EWSGhanaConfig.for_domain(domain)
    return bootstrap_domain(
        EWSApi(domain, GhanaEndpoint.from_config(ews_config)))
Exemplo n.º 19
0
def ews_resync_web_users(request, domain):
    config = EWSGhanaConfig.for_domain(domain)
    endpoint = GhanaEndpoint.from_config(config)
    resync_web_users.delay(EWSApi(domain=domain, endpoint=endpoint))
    return HttpResponse('OK')
Exemplo n.º 20
0
def ews_add_products_to_locs(request, domain):
    config = EWSGhanaConfig.for_domain(domain)
    endpoint = GhanaEndpoint.from_config(config)
    add_products_to_loc.delay(EWSApi(domain=domain, endpoint=endpoint))
    return HttpResponse('OK')
Exemplo n.º 21
0
def ews_resync_passwords(request, domain):
    config = EWSGhanaConfig.for_domain(domain)
    endpoint = GhanaEndpoint.from_config(config)
    resync_webusers_passwords_task.delay(config, endpoint)
    return HttpResponse('OK')
Exemplo n.º 22
0
 def endpoint(self):
     from custom.ewsghana.api import GhanaEndpoint
     return GhanaEndpoint.from_config(EWSGhanaConfig.for_domain(
         self.domain))
Exemplo n.º 23
0
 def endpoint(self):
     from custom.ewsghana.api import GhanaEndpoint
     return GhanaEndpoint.from_config(EWSGhanaConfig.for_domain(self.domain))