Bladeren bron

fix frappe.db.exist function

version-14
Neil Trini Lasrado 10 jaren geleden
bovenliggende
commit
62036a5b89
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. +2
    -2
      frappe/database.py

+ 2
- 2
frappe/database.py Bestand weergeven

@@ -13,7 +13,7 @@ import frappe
import frappe.defaults import frappe.defaults
import re import re
import frappe.model.meta import frappe.model.meta
from frappe.utils import now, get_datetime
from frappe.utils import now, get_datetime, cstr
from frappe import _ from frappe import _


class Database: class Database:
@@ -643,7 +643,7 @@ class Database:
conditions = [] conditions = []
for d in dt: for d in dt:
if d == 'doctype': continue 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' % \ return self.sql('select name from `tab%s` where %s' % \
(dt['doctype'], " and ".join(conditions))) (dt['doctype'], " and ".join(conditions)))
except: except:


Laden…
Annuleren
Opslaan