chore: Remove unused code
- and simplify get_call_log
This commit is contained in:
parent
0e9ebad9c6
commit
39abfae5fe
@ -68,16 +68,9 @@ def update_call_log(call_payload, status="Ringing", call_log=None):
|
|||||||
|
|
||||||
|
|
||||||
def get_call_log(call_payload):
|
def get_call_log(call_payload):
|
||||||
call_log = frappe.get_all(
|
call_log_id = call_payload.get("CallSid")
|
||||||
"Call Log",
|
if frappe.db.exists("Call Log", call_log_id):
|
||||||
{
|
return frappe.get_doc("Call Log", call_log_id)
|
||||||
"id": call_payload.get("CallSid"),
|
|
||||||
},
|
|
||||||
limit=1,
|
|
||||||
)
|
|
||||||
|
|
||||||
if call_log:
|
|
||||||
return frappe.get_doc("Call Log", call_log[0].name)
|
|
||||||
|
|
||||||
|
|
||||||
def create_call_log(call_payload):
|
def create_call_log(call_payload):
|
||||||
|
@ -95,14 +95,6 @@ class CallLog(Document):
|
|||||||
frappe.publish_realtime("show_call_popup", self, user=email)
|
frappe.publish_realtime("show_call_popup", self, user=email)
|
||||||
|
|
||||||
|
|
||||||
def get_employee_name(emp):
|
|
||||||
employee_name = ""
|
|
||||||
for name in ["first_name", "middle_name", "last_name"]:
|
|
||||||
if emp.get(name):
|
|
||||||
employee_name += (" " if employee_name else "") + emp.get(name)
|
|
||||||
return employee_name
|
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def add_call_summary_and_call_type(call_log, summary, call_type):
|
def add_call_summary_and_call_type(call_log, summary, call_type):
|
||||||
doc = frappe.get_doc("Call Log", call_log)
|
doc = frappe.get_doc("Call Log", call_log)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user