def post(self, request, **kwargs): application_id = str(kwargs["pk"]) response, _ = post_case_notes(request, application_id, request.POST) if "errors" in response: return self.get(request, error=response["errors"]["text"][0], text=request.POST.get("text"), **kwargs) return redirect(reverse_lazy("applications:notes", kwargs={"pk": application_id}))
def post(self, request, **kwargs): if self.view_type != "case-notes": return Http404 response, _ = post_case_notes(request, self.case_id, request.POST) if "errors" in response: return self.get(request, error=response["errors"]["text"][0], text=request.POST.get("text"), **kwargs) return redirect( reverse_lazy("end_users:end_user_detail", kwargs={"pk": self.end_user_advisory_id, "type": "case-notes"}) )
def post(self, request, **kwargs): if self.view_type != "case-notes": return Http404 response, _ = post_case_notes(request, self.case_id, request.POST) if "errors" in response: return self.get(request, error=response["errors"], text=request.POST.get("text"), **kwargs) return redirect( reverse_lazy("applications:application", kwargs={"pk": self.application_id, "type": "case-notes"}) )
def post(self, request, **kwargs): if self.view_type != "case-notes": return Http404 good_id = kwargs["pk"] data, _ = get_good(request, str(good_id), full_detail=True) response, _ = post_case_notes(request, data["case_id"], request.POST) if "errors" in response: return self.get(request, error=response["errors"]["text"][0], text=request.POST.get("text"), **kwargs) return redirect(reverse_lazy("goods:good_detail", kwargs={"pk": good_id, "type": "case-notes"}))