chore: Remove unused code

- and simplify get_call_log
This commit is contained in:
Suraj Shetty 2022-04-04 07:28:41 +05:30
parent 0e9ebad9c6
commit 39abfae5fe
2 changed files with 3 additions and 18 deletions

View File

@ -68,16 +68,9 @@ def update_call_log(call_payload, status="Ringing", call_log=None):
def get_call_log(call_payload):
call_log = frappe.get_all(
"Call Log",
{
"id": call_payload.get("CallSid"),
},
limit=1,
)
if call_log:
return frappe.get_doc("Call Log", call_log[0].name)
call_log_id = call_payload.get("CallSid")
if frappe.db.exists("Call Log", call_log_id):
return frappe.get_doc("Call Log", call_log_id)
def create_call_log(call_payload):

View File

@ -95,14 +95,6 @@ class CallLog(Document):
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()
def add_call_summary_and_call_type(call_log, summary, call_type):
doc = frappe.get_doc("Call Log", call_log)