Browse Source

Allow special character %

master
venkataakhil 1 year ago
parent
commit
ce81ec93ff
  1. 1
      smart_service/apis/master_api.py
  2. 1
      smart_service/apis/publish_api.py
  3. 2
      smart_service/transactions/doctype/procedure/procedure.js
  4. 10
      smart_service/transactions/doctype/procedure/procedure.py

1
smart_service/apis/master_api.py

@ -445,6 +445,7 @@ def file_not_exists():
isExist = os.path.exists(base_path + path)
if not isExist:
print(d)
changed_file_list.append(d)
file_path_not_exists = base_path + "/files/json_files/1.json"

1
smart_service/apis/publish_api.py

@ -35,6 +35,7 @@ def custom_rate_limit(limit, seconds):
return "You hit the rate limit because of too many requests. Please try after sometime."
return 1
def get_parent_map(input_list, parameter):
parentChildMap = {}
for b in input_list:

2
smart_service/transactions/doctype/procedure/procedure.js

@ -36,7 +36,7 @@ frappe.ui.form.on('Procedure', {
},
validate: function (frm) {
// var regex = /[@#$%^*\\[\]{}`~\\|\?]/;
var regex = /[@#$%^\\[\]{}`\\|\?]/;
var regex = /[@#$^\\[\]{}`\\|\?]/;
if (frm.doc.procedure_details) {
for (var i = 0; i < frm.doc.procedure_details.length; i++) {
if (regex.test(frm.doc.procedure_details[i].content) === true) {

10
smart_service/transactions/doctype/procedure/procedure.py

@ -14,9 +14,7 @@ class Procedure(Document):
if self.procedure_details:
for x in self.get("procedure_details"):
if x.content:
# try:
# title = x.content.encode('cp1252').decode('UTF-8')
# frappe.msgprint(str(x.as_dict())+":" +str(title))
res_str = re.sub("–", "", x.content)
res_str = re.sub("—", "", res_str)
res_str = re.sub("‘", "", res_str)
@ -24,12 +22,8 @@ class Procedure(Document):
res_str = re.sub("“", "", res_str)
res_str = re.sub("”", "", res_str)
res_str = re.sub("Â", "", res_str)
x.content = res_str
# frappe.msgprint(str(title))
# except Exception as e:
# frappe.log_error("validate encoding",frappe.get_traceback())
if x.content_type == "File":
if not x.file:
frappe.throw("Please choose the file in row no " + str(x.idx))

Loading…
Cancel
Save