Quellcode durchsuchen

fixed export_query method: only encode strings of type unicode

version-14
Anand Doshi vor 13 Jahren
Ursprung
Commit
a308d12f0e
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. +2
    -1
      py/webnotes/widgets/doclistview.py

+ 2
- 1
py/webnotes/widgets/doclistview.py Datei anzeigen

@@ -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')


Laden…
Abbrechen
Speichern