@require_json
@require_POST
@require_api_key
def update_build_status(request, repository_name, build_number):
    """
    Update a build status. Useful when another
    separate micro-service runs the builds.
    """
    try:
        status = request.json['status']
    except (__HOLE__, KeyError):
        return JsonResponse({'error': 'Missing status field.'}, status=400)

    build = get_object_or_404(Build, repository__name=repository_name, number=build_number)
    try:
        build.update_status(status)
    except InvalidStatus as error:
        return JsonResponse({'error': str(error)}, status=400)
    except MissingToken:
        return JsonResponse({'error': 'No token.'}, status=400)

    return JsonResponse({})
dataset/ETHPy150Open m-vdb/github-buildservice-boilerplate/buildservice/views/api.py/update_build_status