예제 #1
0
파일: views.py 프로젝트: markrickert/kegbot
def debug_log(request):
  if request.method != 'POST' or not settings.HAVE_RAVEN or not settings.HAVE_SENTRY:
    raise Http404('Method not supported')

  form = forms.DebugLogForm(request.POST)
  if not form.is_valid():
    raise krest.BadRequestError(_form_errors(form))
  client = LocalRavenClient([])
  message = form.cleaned_data['message']
  ident = client.get_ident(client.create_from_text(message))
  client.send()
  return {'log_id': ident}
예제 #2
0
파일: views.py 프로젝트: swc/kegbot
def debug_log(request):
    if request.method != 'POST' or not settings.HAVE_RAVEN or not settings.HAVE_SENTRY:
        raise Http404('Method not supported')

    form = forms.DebugLogForm(request.POST)
    if not form.is_valid():
        raise kbapi.BadRequestError(_form_errors(form))
    client = LocalRavenClient([])
    message = form.cleaned_data['message']
    ident = client.get_ident(client.create_from_text(message))
    client.send()
    return {'log_id': ident}
예제 #3
0
def report(request, project_id=None):
    if request.method == 'POST':
        data = request.raw_post_data
        if not data:
            return HttpResponseBadRequest()

        try:
            decoded = simplejson.loads(data)
        except simplejson.JSONDecodeError:
            return HttpResponseBadRequest()

        response = HttpResponse()
        client.send(auth_header=extract_auth_vars(request), **decoded)

    elif request.method == 'OPTIONS':
        response = HttpResponse()

    return response
예제 #4
0
def report(request, project_id=None):
    if request.method == 'POST':
        data = request.raw_post_data
        if not data:
            return HttpResponseBadRequest()

        try:
            decoded = simplejson.loads(data)
        except simplejson.JSONDecodeError:
            return HttpResponseBadRequest()

        response = HttpResponse()
        client.send(auth_header=extract_auth_vars(request), **decoded)

    elif request.method == 'OPTIONS':
        response = HttpResponse()

    return response
예제 #5
0
파일: views.py 프로젝트: seacoastboy/raven
def report(request):
    if request.method == 'POST':
        data = request.raw_post_data
        if not data:
            return HttpResponseBadRequest()

        try:
            decoded = simplejson.loads(data)
        except simplejson.JSONDecodeError:
            return HttpResponseBadRequest()

        response = HttpResponse()
        client.send(**decoded)

    elif request.method == 'OPTIONS':
        response = HttpResponse()

    return response
예제 #6
0
파일: views.py 프로젝트: connoryang/1v1dec
def report(request, project_id=None):
    if request.method == 'OPTIONS':
        return HttpResponse()
    if request.method == 'POST':
        if hasattr(request, 'body'):
            data = request.body
        else:
            data = request.raw_post_data
    else:
        data = request.GET.get('sentry_data')
    if not data:
        return HttpResponseBadRequest()
    try:
        decoded = json.loads(data.decode('utf8'))
    except json.JSONDecodeError:
        return HttpResponseBadRequest()

    client.send(auth_header=extract_auth_vars(request), **decoded)
    return HttpResponse()
예제 #7
0
파일: views.py 프로젝트: raffstah/raven
def report(request, project_id=None):
    if request.method == 'OPTIONS':
        return HttpResponse()

    if request.method == 'POST':
        data = request.raw_post_data
    else:
        data = request.GET.get('sentry_data')

    if not data:
        return HttpResponseBadRequest()

    try:
        decoded = json.loads(data)
    except json.JSONDecodeError:
        return HttpResponseBadRequest()

    client.send(auth_header=extract_auth_vars(request), **decoded)

    return HttpResponse()
예제 #8
0
def report(request, project_id=None):
    if request.method == "OPTIONS":
        return HttpResponse()

    if request.method == "POST":
        if hasattr(request, "body"):
            data = request.body
        else:
            data = request.raw_post_data
    else:
        data = request.GET.get("sentry_data")

    if not data:
        return HttpResponseBadRequest()

    try:
        decoded = json.loads(data.decode("utf8"))
    except json.JSONDecodeError:
        return HttpResponseBadRequest()

    client.send(auth_header=extract_auth_vars(request), **decoded)

    return HttpResponse()