Skip to content

Commit

Permalink
refactor: avoid deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Apr 30, 2024
1 parent b5bc8b3 commit 1a3c232
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frappe/core/doctype/comment/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def update_comments_in_parent(reference_doctype, reference_name, _comments):
)

except Exception as e:
if frappe.db.is_column_missing(e) and getattr(frappe.local, "request", None):
if frappe.db.is_missing_column(e) and getattr(frappe.local, "request", None):
pass
elif frappe.db.is_data_too_long(e):
raise frappe.DataTooLongException
Expand Down
4 changes: 2 additions & 2 deletions frappe/desk/doctype/tag/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def check_user_tags(dt):
doctype = DocType(dt)
frappe.qb.from_(doctype).select(doctype._user_tags).limit(1).run()
except Exception as e:
if frappe.db.is_column_missing(e):
if frappe.db.is_missing_column(e):
DocTags(dt).setup()


Expand Down Expand Up @@ -118,7 +118,7 @@ def update(self, dn, tl):
doc = frappe.get_doc(self.dt, dn)
update_tags(doc, tags)
except Exception as e:
if frappe.db.is_column_missing(e):
if frappe.db.is_missing_column(e):
if not tags:
# no tags, nothing to do
return
Expand Down
2 changes: 1 addition & 1 deletion frappe/desk/doctype/todo/todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def update_in_reference(self):
# no table
return

elif frappe.db.is_column_missing(e):
elif frappe.db.is_missing_column(e):
from frappe.database.schema import add_column

add_column(self.reference_type, "_assign", "Text")
Expand Down
2 changes: 1 addition & 1 deletion frappe/desk/like.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _toggle_like(doctype, name, add, user=None):
frappe.db.set_value(doctype, name, "_liked_by", json.dumps(liked_by), update_modified=False)

except frappe.db.ProgrammingError as e:
if frappe.db.is_column_missing(e):
if frappe.db.is_missing_column(e):
add_column(doctype, "_liked_by", "Text")
_toggle_like(doctype, name, add, user)
else:
Expand Down

0 comments on commit 1a3c232

Please sign in to comment.