refactor(treewide): formatting and ruff fixes, + manually enabled F401

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang
2024-03-27 11:37:26 +05:30
parent c28d19cf7f
commit 4d34b1ead7
618 changed files with 4188 additions and 6384 deletions

View File

@@ -23,7 +23,7 @@ def handle_incoming_call(**kwargs):
create_call_log(call_payload)
else:
update_call_log(call_payload, call_log=call_log)
except Exception as e:
except Exception:
frappe.db.rollback()
exotel_settings.log_error("Error in Exotel incoming call")
frappe.db.commit()
@@ -86,7 +86,7 @@ def create_call_log(call_payload):
@frappe.whitelist()
def get_call_status(call_id):
endpoint = get_exotel_endpoint("Calls/{call_id}.json".format(call_id=call_id))
endpoint = get_exotel_endpoint(f"Calls/{call_id}.json")
response = requests.get(endpoint)
status = response.json().get("Call", {}).get("Status")
return status
@@ -95,9 +95,7 @@ def get_call_status(call_id):
@frappe.whitelist()
def make_a_call(from_number, to_number, caller_id):
endpoint = get_exotel_endpoint("Calls/connect.json?details=true")
response = requests.post(
endpoint, data={"From": from_number, "To": to_number, "CallerId": caller_id}
)
response = requests.post(endpoint, data={"From": from_number, "To": to_number, "CallerId": caller_id})
return response.json()