Merge pull request #764 from anandpdoshi/anand-august-11

[fix] Enclose add_fetch fields in '`'
This commit is contained in:
Anand Doshi 2014-08-11 14:14:48 +05:30
commit 9c2a2e28b4

View file

@ -48,6 +48,9 @@ def validate_link():
# get fetch values
if fetch:
# escape with "`"
fetch = ", ".join(("`{0}`".format(f.strip()) for f in fetch.split(",")))
frappe.response['fetch_values'] = [frappe.utils.parse_val(c) \
for c in frappe.db.sql("select %s from `tab%s` where name=%s" \
% (fetch, options, '%s'), (value,))[0]]