def revoke_sanction(request, pk, comment): response = client.patch( request=request, appended_address=f"/external-data/sanction/{pk}/", data={ "is_revoked": True, "is_revoked_comment": comment }, ) response.raise_for_status()
def revoke_denial(request, pk, comment): response = client.patch( request=request, appended_address=f"/external-data/denial/{pk}/", data={ "is_revoked": True, "is_revoked_comment": comment }, ) response.raise_for_status() return response.json()
def update_site(request, pk, json): organisation_id = request.session["organisation"] response = client.patch(request, f"/organisations/{organisation_id}/sites/{pk}/", data=json,) return response.json(), response.status_code
def set_open_general_licence_status(request, pk, json): if "status" not in json: return {"errors": {"response": [open_general_licences.Edit.SELECT_OPTION]}}, HTTPStatus.BAD_REQUEST response = client.patch(request, f"/open-general-licences/{pk}", json) return response.json(), response.status_code
def patch_open_general_licence(request, pk, json): response = client.patch(request, f"/open-general-licences/{pk}", json) return response.json(), response.status_code
def update_flag(request, pk, json): data = client.patch(request, f"/flags/{pk}/", json) return data.json(), data.status_code
def patch_compliance_visit_case(request, case_id, json): if "visit_date_day" in json: json["visit_date"] = format_date(json, "visit_date_") data = client.patch(request, f"/compliance/visit/{case_id}", data=json) return data.json(), data.status_code
def patch_case(request, pk, json): response = client.patch(request, f"/cases/{pk}", json) return response.json(), response.status_code