Skip to content

Commit

Permalink
fix: dont db_set on unsaved document (#18460)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1bd61d5)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Oct 19, 2022
1 parent a63c759 commit eca94aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frappe/model/document.py
Expand Up @@ -1169,6 +1169,9 @@ def db_set(self, fieldname, value=None, update_modified=True, notify=False, comm
# to trigger notification on value change
self.run_method("before_change")

if self.name is None:
return

frappe.db.set_value(
self.doctype,
self.name,
Expand Down

0 comments on commit eca94aa

Please sign in to comment.