Sfoglia il codice sorgente

[fix] convert filenames to unicode, fixes #2510

version-14
Rushabh Mehta 8 anni fa
parent
commit
fde70fed93
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. +1
    -1
      frappe/core/doctype/file/file.py

+ 1
- 1
frappe/core/doctype/file/file.py Vedi File

@@ -132,7 +132,7 @@ class File(NestedSet):
if not self.file_name: if not self.file_name:
self.file_name = self.file_url.split("/files/")[-1] self.file_name = self.file_url.split("/files/")[-1]


if not os.path.exists(get_files_path(self.file_name.lstrip("/"))):
if not os.path.exists(get_files_path(frappe.as_unicode(self.file_name.lstrip("/")))):
frappe.throw(_("File {0} does not exist").format(self.file_url), IOError) frappe.throw(_("File {0} does not exist").format(self.file_url), IOError)


def validate_duplicate_entry(self): def validate_duplicate_entry(self):


Caricamento…
Annulla
Salva