@require_POST
@require_uth_domain
@login_or_basic
def sonosite_upload(request, domain, **kwargs):

    response_data = {}

    try:
        config_file = request.FILES['PT_PPS.XML'].read()
    except Exception as e:
        response_data['result'] = 'failed'
        response_data['message'] = 'Could not load config file: %s' % (e.message)
        return HttpResponse(
            json.dumps(response_data),
            content_type="application/json",
            status=500
        )

    case_id = get_case_id(config_file)
    study_id = get_study_id(config_file)

    upload = SonositeUpload(
        study_id=study_id,
        related_case_id=case_id,
    )
    upload.save()

    put_request_files_in_doc(request, upload)

    async_create_case.delay(upload._id)

    response_data['result'] = 'uploaded'
    response_data['message'] = 'uploaded'
    return HttpResponse(json.dumps(response_data), content_type="application/json")
Parse the network line
dataset/ETHPy150Open dimagi/commcare-hq/custom/uth/views.py/sonosite_upload--crossover with--dataset/ETHPy150Open saltstack/salt/salt/utils/kickstart.py/parse_network