diff --git a/frappe/website/doctype/website_sitemap/website_sitemap.py b/frappe/website/doctype/website_sitemap/website_sitemap.py index b4b493cb0b..4c518f8eff 100644 --- a/frappe/website/doctype/website_sitemap/website_sitemap.py +++ b/frappe/website/doctype/website_sitemap/website_sitemap.py @@ -38,7 +38,7 @@ class DocType(DocTypeNestedSet): if self.doc.old_parent != self.doc.parent_website_sitemap: frappe.conn.sql("""update `tabWebsite Sitemap` set idx=idx-1 where parent_website_sitemap=%s and idx>%s""", (self.doc.old_parent, self.doc.idx)) - frappe.conn.sql("""update `tab{}` set idx=idx-1 + frappe.conn.sql("""update `tab{0}` set idx=idx-1 where parent_website_sitemap=%s and idx>%s""".format(self.doc.ref_doctype), (self.doc.old_parent, self.doc.idx)) self.doc.idx = None @@ -160,4 +160,4 @@ def cleanup_sitemap(): where not exists(select name from `tabWebsite Sitemap Config` wsc where wsc.name=ws.website_sitemap_config)""") - frappe.delete_doc("Website Sitemap", to_delete, ignore_permissions=True) \ No newline at end of file + frappe.delete_doc("Website Sitemap", to_delete, ignore_permissions=True)