fix: only load whatsapp api's if whatsapp is installed
This commit is contained in:
parent
60386e97e6
commit
b889734cd1
@ -50,10 +50,14 @@ def parse_mobile_no(mobile_no: str):
|
||||
|
||||
@frappe.whitelist()
|
||||
def is_whatsapp_enabled():
|
||||
if not frappe.db.exists('DocType', 'WhatsApp Settings'):
|
||||
return False
|
||||
return frappe.get_cached_value('WhatsApp Settings', 'WhatsApp Settings', 'enabled')
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_whatsapp_messages(reference_doctype, reference_name):
|
||||
if not frappe.db.exists('DocType', 'WhatsApp Message'):
|
||||
return []
|
||||
messages = frappe.get_all(
|
||||
"WhatsApp Message",
|
||||
filters={
|
||||
|
||||
@ -768,6 +768,7 @@
|
||||
:doc="doc.data?.name"
|
||||
/>
|
||||
<WhatsappTemplateSelectorModal
|
||||
v-if="whatsappEnabled"
|
||||
v-model="showWhatsappTemplates"
|
||||
@send="(t) => sendTemplate(t)"
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user