Skip to content

Commit

Permalink
fix: rename fields for html, col, section, etc. (#26188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nihantra-Patel committed Apr 29, 2024
1 parent fda0edc commit 1a2411c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frappe/custom/doctype/custom_field/custom_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ def rename_fieldname(custom_field: str, fieldname: str):
frappe.msgprint(_("Old and new fieldnames are same."), alert=True)
return

frappe.db.rename_column(parent_doctype, old_fieldname, new_fieldname)
if frappe.db.has_column(field.dt, old_fieldname):
frappe.db.rename_column(parent_doctype, old_fieldname, new_fieldname)

# Update in DB after alter column is successful, alter column will implicitly commit, so it's
# best to commit change on field too to avoid any possible mismatch between two.
Expand Down

0 comments on commit 1a2411c

Please sign in to comment.