fix: Add additional check to ensure doc_before save exists
This commit is contained in:
parent
eb0ca67ced
commit
a86a07ef37
@ -75,10 +75,11 @@
|
||||
{
|
||||
"fieldname": "medium",
|
||||
"fieldtype": "Data",
|
||||
"label": "Medium"
|
||||
"label": "Medium",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"modified": "2019-06-17 08:21:20.665441",
|
||||
"modified": "2019-06-17 09:02:48.150383",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Communication",
|
||||
"name": "Call Log",
|
||||
|
@ -15,5 +15,5 @@ class CallLog(Document):
|
||||
|
||||
def on_update(self):
|
||||
doc_before_save = self.get_doc_before_save()
|
||||
if doc_before_save.status in ['Ringing'] and self.status in ['Missed', 'Completed']:
|
||||
if doc_before_save and doc_before_save.status in ['Ringing'] and self.status in ['Missed', 'Completed']:
|
||||
frappe.publish_realtime('call_{id}_disconnected'.format(id=self.id), self)
|
||||
|
Loading…
Reference in New Issue
Block a user