seitime-frappe/frappe/patches/v13_0/remove_twilio_settings.py
Suraj Shetty c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30

20 lines
749 B
Python

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
def execute():
"""Add missing Twilio patch.
While making Twilio as a standaone app, we missed to delete Twilio records from DB through migration. Adding the missing patch.
"""
frappe.delete_doc_if_exists("DocType", "Twilio Number Group")
if twilio_settings_doctype_in_integrations():
frappe.delete_doc_if_exists("DocType", "Twilio Settings")
frappe.db.delete("Singles", {"doctype": "Twilio Settings"})
def twilio_settings_doctype_in_integrations() -> bool:
"""Check Twilio Settings doctype exists in integrations module or not."""
return frappe.db.exists("DocType", {"name": "Twilio Settings", "module": "Integrations"})