[fix] [file manager] unicode issue in get_file_name()

This commit is contained in:
Anand Doshi 2014-12-29 12:17:30 +05:30
parent 5d0ab13266
commit da9bbf8f09

View file

@ -251,7 +251,7 @@ def get_content_hash(content):
def get_file_name(fname, optional_suffix):
n_records = frappe.db.sql("select name from `tabFile Data` where file_name=%s", fname)
if len(n_records) > 0 or os.path.exists(get_files_path(fname.encode('utf-8'))):
if len(n_records) > 0 or os.path.exists(get_files_path(fname).encode('utf-8')):
f = fname.rsplit('.', 1)
if len(f) == 1:
partial, extn = f[0], ""