From 62036a5b89065cb00e8c3079d8c8c66f11dce094 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 12 Jan 2015 12:22:43 +0530 Subject: [PATCH] fix frappe.db.exist function --- frappe/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/database.py b/frappe/database.py index 50e06c7d88..b6685d074f 100644 --- a/frappe/database.py +++ b/frappe/database.py @@ -13,7 +13,7 @@ import frappe import frappe.defaults import re import frappe.model.meta -from frappe.utils import now, get_datetime +from frappe.utils import now, get_datetime, cstr from frappe import _ class Database: @@ -643,7 +643,7 @@ class Database: conditions = [] for d in dt: if d == 'doctype': continue - conditions.append('`%s` = "%s"' % (d, dt[d].replace('"', '\"'))) + conditions.append('`%s` = "%s"' % (d, cstr(dt[d]).replace('"', '\"'))) return self.sql('select name from `tab%s` where %s' % \ (dt['doctype'], " and ".join(conditions))) except: