From 19e16d8a5a161cdffbfe8e90d8a0366dc4a787ee Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Sat, 16 May 2020 20:08:38 +0530 Subject: [PATCH] fix: TypeError in cmp --- frappe/contacts/doctype/contact/contact.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/contacts/doctype/contact/contact.py b/frappe/contacts/doctype/contact/contact.py index 99068dcf6d..4cf209541c 100644 --- a/frappe/contacts/doctype/contact/contact.py +++ b/frappe/contacts/doctype/contact/contact.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cstr, has_gravatar +from frappe.utils import cstr, has_gravatar, cint from frappe import _ from frappe.model.document import Document from frappe.core.doctype.dynamic_link.dynamic_link import deduplicate_dynamic_links @@ -133,7 +133,7 @@ def get_default_contact(doctype, name): dl.parenttype = "Contact"''', (doctype, name)) if out: - return sorted(out, key = functools.cmp_to_key(lambda x,y: cmp(y[1], x[1])))[0][0] + return sorted(out, key = functools.cmp_to_key(lambda x,y: cmp(cint(y[1]), cint(x[1]))))[0][0] else: return None