@unique_session_or_json_redirect
def getdistrictfilestatus(request, planid):
    """
    Given a plan id, return the status of the district index file
    """    
    note_session_activity(request)

    status = { 'success':False }
    plan = Plan.objects.get(pk=planid)
    if not can_copy(request.user, plan):
        return HttpResponseForbidden()
    try:
        is_shape = 'type' in request.REQUEST and request.REQUEST['type'] == 'shape'
        file_status = DistrictFile.get_file_status(plan, shape=is_shape)
        status['success'] = True
        status['status'] = file_status 
    except Exception as ex:
        status['message'] = _('Failed to get file status')
        status['exception'] = ex 
    return HttpResponse(json.dumps(status),mimetype='application/json')
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/views.py/getdistrictfilestatus/original