From ee0e4e0a440bc3587f7fa075f67809910fc3457a Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sun, 3 May 2020 20:46:21 +0530 Subject: [PATCH] fix: '>' not supported between instances of 'int' and 'NoneType' --- frappe/contacts/doctype/contact/contact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/contacts/doctype/contact/contact.py b/frappe/contacts/doctype/contact/contact.py index 82311b19d4..99068dcf6d 100644 --- a/frappe/contacts/doctype/contact/contact.py +++ b/frappe/contacts/doctype/contact/contact.py @@ -123,7 +123,7 @@ class Contact(Document): def get_default_contact(doctype, name): '''Returns default contact for the given doctype, name''' out = frappe.db.sql('''select parent, - (select is_primary_contact from tabContact c where c.name = dl.parent) + IFNULL((select is_primary_contact from tabContact c where c.name = dl.parent), 0) as is_primary_contact from `tabDynamic Link` dl