Merge pull request #8137 from sahil28297/fix_dynamic_patch

fix(patch): escape illegal characters
This commit is contained in:
mergify[bot] 2019-08-12 10:15:30 +00:00 committed by GitHub
commit d9143a13ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,15 +20,15 @@ def execute():
if communication.timeline_doctype and communication.timeline_name:
name += 1
values.append("""({0}, "{1}", "timeline_links", "Communication", "{2}", "{3}", "{4}", "{5}", "{6}", "{7}")""".format(
counter, str(name), communication.name, communication.timeline_doctype,
communication.timeline_name, communication.creation, communication.modified, communication.modified_by
counter, str(name), frappe.db.escape(communication.name), frappe.db.escape(communication.timeline_doctype),
frappe.db.escape(communication.timeline_name), communication.creation, communication.modified, communication.modified_by
))
counter += 1
if communication.link_doctype and communication.link_name:
name += 1
values.append("""({0}, "{1}", "timeline_links", "Communication", "{2}", "{3}", "{4}", "{5}", "{6}", "{7}")""".format(
counter, str(name), communication.name, communication.link_doctype,
communication.link_name, communication.creation, communication.modified, communication.modified_by
counter, str(name), frappe.db.escape(communication.name), frappe.db.escape(communication.link_doctype),
frappe.db.escape(communication.link_name), communication.creation, communication.modified, communication.modified_by
))
if values and (count % 10000 == 0 or count == len(communications) - 1):
@ -41,4 +41,4 @@ def execute():
values = []
frappe.db.add_index("Communication Link", ["link_doctype", "link_name"])
frappe.db.add_index("Communication Link", ["link_doctype", "link_name"])