fix: don't try to rename a doctype that doesn't exist (#28487)
When migrating a database that doesn't contain a table for "Marketing Campaign" yet (because it was added in a later, in-between version), this patch used to fail. Now we attempt to rename the doctype only if it exists. The patch was introduced in https://github.com/frappe/frappe/pull/27801
This commit is contained in:
parent
c3a6f750bb
commit
585dae2053
1 changed files with 4 additions and 0 deletions
|
|
@ -7,5 +7,9 @@ def execute():
|
|||
"""
|
||||
if frappe.db.exists("DocType", "UTM Campaign"):
|
||||
return
|
||||
|
||||
if not frappe.db.exists("DocType", "Marketing Campaign"):
|
||||
return
|
||||
|
||||
frappe.rename_doc("DocType", "Marketing Campaign", "UTM Campaign", force=True)
|
||||
frappe.reload_doctype("UTM Campaign", force=True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue