Ejemplo n.º 1
0
def get_details_match(request, match_id):
    try:
        match = utils.get_details_match(match_id)
        return JsonResponse(serializers.detail_match_serializer(match))
    except exceptions.APIError as e:
        return JsonResponse({
            'message': 'No match was found',
            'volvo_message': e.msg,
            'match_id': match_id
        }, status=404)
Ejemplo n.º 2
0
def download_match(match_id, set_skill):
    log.info("parsing: {}".format(match_id))
    exist = models.DetailMatch.objects.filter(match_id=match_id)
    if exist:
        log.info("already parsed, skipping: {}".format(match_id))
        return exist[0]
    else:
        with transaction.atomic():
            match = utils.get_details_match(match_id)

        if set_skill:
            schedule_determine_skill(match.match_id)
        else:
            match.skill = 4
            match.save()
        log.info("parsed: {}".format(match.match_id))
        return match