예제 #1
0
파일: tasks.py 프로젝트: ekush/commcare-hq
def import_products_async(domain, file_ref_id):
    importer = SingleExcelImporter(import_products_async, file_ref_id)
    results = import_products(domain, importer)
    importer.mark_complete()

    return {
        'messages': results
    }
예제 #2
0
def import_products_async(domain, file_ref_id):
    try:
        importer = SingleExcelImporter(import_products_async, file_ref_id)
    except UnknownFileRefException:
        return {
            'messages': {
                'errors': [_("Sorry, something went wrong! Please try again and report an "
                             "issue if the problem persists")]
            }
        }

    results = import_products(domain, importer)
    importer.mark_complete()

    return {
        'messages': results
    }
예제 #3
0
def import_products_async(domain, file_ref_id):
    try:
        importer = SingleExcelImporter(import_products_async, file_ref_id)
    except UnknownFileRefException:
        return {
            'messages': {
                'errors': [
                    _("Sorry, something went wrong! Please try again and report an "
                      "issue if the problem persists")
                ]
            }
        }

    results = import_products(domain, importer)
    importer.mark_complete()

    return {'messages': results}