Pārlūkot izejas kodu

fixed export_query method: only encode strings of type unicode

version-14
Anand Doshi pirms 13 gadiem
vecāks
revīzija
a308d12f0e
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. +2
    -1
      py/webnotes/widgets/doclistview.py

+ 2
- 1
py/webnotes/widgets/doclistview.py Parādīt failu

@@ -240,7 +240,8 @@ def export_query():
writer = csv.writer(f)
from webnotes.utils import cstr
for r in data:
writer.writerow([v.encode('utf-8') for v in r])
# encode only unicode type strings and not int, floats etc.
writer.writerow(map(lambda v: isinstance(v, unicode) and v.encode('utf-8') or v, r))

f.seek(0)
webnotes.response['result'] = unicode(f.read(), 'utf-8')


Notiek ielāde…
Atcelt
Saglabāt