Quellcode durchsuchen

Update datautils.py

version-14
Nabin Hait vor 12 Jahren
Ursprung
Commit
c969c0301c
1 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
  1. +4
    -3
      webnotes/utils/datautils.py

+ 4
- 3
webnotes/utils/datautils.py Datei anzeigen

@@ -63,10 +63,11 @@ def read_csv_content(fcontent, ignore_encoding=False):
try: try:
newrow.append(unicode(val.strip(), 'utf-8')) newrow.append(unicode(val.strip(), 'utf-8'))
except UnicodeDecodeError, e: except UnicodeDecodeError, e:
raise Exception, """Some character(s) in row #%s, column #%s are
webnotes.msgprint("""Some character(s) in row #%s, column #%s are
not readable by utf-8. Ignoring them. If you are importing a non not readable by utf-8. Ignoring them. If you are importing a non
english language, please make sure your file is saved in the 'utf-8' english language, please make sure your file is saved in the 'utf-8'
encoding.""" % (csvrows.index(row)+1, row.index(val)+1)
encoding.""" % (csvrows.index(row)+1, row.index(val)+1))
raise Exception
rows.append(newrow) rows.append(newrow)
@@ -169,4 +170,4 @@ def import_doc(d, doctype, overwrite, row_idx, submit=False):
bean.doc.fields['name'])) bean.doc.fields['name']))
def getlink(doctype, name): def getlink(doctype, name):
return '<a href="#Form/%(doctype)s/%(name)s">%(name)s</a>' % locals()
return '<a href="#Form/%(doctype)s/%(name)s">%(name)s</a>' % locals()

Laden…
Abbrechen
Speichern