def update_ci(request, indicator_id, ci_type): """ Update an indicator's confidence/impact. Should be an AJAX POST. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :param indicator_id: The ObjectId of the indicator to update. :type indicator_id: str :param ci_type: Whether we are updating confidence or impact. :type ci_type: str ("confidence", "impact") :returns: :class:`django.http.HttpResponse` """ if request.method == "POST" and request.is_ajax(): value = request.POST["value"] analyst = request.user.username return HttpResponse(json.dumps(ci_update(indicator_id, ci_type, value, analyst)), mimetype="application/json")
def update_ci(request, indicator_id, ci_type): """ Update an indicator's confidence/impact. Should be an AJAX POST. :param request: Django request object (Required) :type request: :class:`django.http.HttpRequest` :param indicator_id: The ObjectId of the indicator to update. :type indicator_id: str :param ci_type: Whether we are updating confidence or impact. :type ci_type: str ("confidence", "impact") :returns: :class:`django.http.HttpResponse` """ if request.method == "POST" and request.is_ajax(): value = request.POST['value'] analyst = request.user.username return HttpResponse(json.dumps( ci_update(indicator_id, ci_type, value, analyst)), content_type="application/json")