From f228502abb88f7f3d186bdb3ba33f12f85a8a0e8 Mon Sep 17 00:00:00 2001 From: venkata akhil Date: Thu, 19 Oct 2023 13:08:37 +0530 Subject: [PATCH] validation fixes in mst,qwik service and publish --- smart_service/apis/v2/master.py | 56 +++++- .../doctype/instructions/instructions.json | 5 +- .../qwik_procedure/qwik_procedure.json | 2 +- .../doctype/qwik_service/qwik_service.js | 1 + .../doctype/qwik_service/qwik_service.py | 8 - .../qwik_service_content.json | 5 +- .../special_tool_information.js | 21 +- .../special_tool_information.json | 24 +-- .../special_tool_information.py | 6 + .../transactions/doctype/publish/publish.js | 8 +- .../transactions/doctype/publish/publish.py | 184 ++++++++++-------- 11 files changed, 203 insertions(+), 117 deletions(-) diff --git a/smart_service/apis/v2/master.py b/smart_service/apis/v2/master.py index a15ca24..023418c 100644 --- a/smart_service/apis/v2/master.py +++ b/smart_service/apis/v2/master.py @@ -4,16 +4,39 @@ from urllib import request import datetime from frappe import utils import json +import html import os from smart_service.apis.app_user_login import input_validation from frappe.utils import cstr + site_name = cstr(frappe.local.site) BASE_URL = os.path.expanduser( "~") + "/frappe-bench/sites/" + site_name + "/public" + date_format = "%Y-%m-%d %H:%M:%S.%f" current_db_name = frappe.conf.get("db_name") +# style="""""" + @frappe.whitelist(methods=["POST"], allow_guest=1) def get_role_mapping(): @@ -171,12 +194,43 @@ def new_publish(): elif module == 'QWIK Service': flag, data = get_qwik_service(variant, language) - CLEANR = re.compile('<.*?>') + CLEANR = re.compile('<.*?>') + CLEANR_back_slash = re.compile("\"") + ul_html='' + find_last_ul='' + for dt in data: if len(dt['consumables'])>0: for con in dt['consumables']: if con['content']: con['content'] = re.sub(CLEANR, '', con['content']) + if dt['qwik_procedure']: + for qp in dt['qwik_procedure']['LHS']: + if qp['content']: + qp['content'] = re.sub('