encode unicode objects

This commit is contained in:
Zlash65 2018-03-26 14:59:17 +05:30
parent d58c1c88e2
commit fae68f7d35

View file

@ -397,5 +397,6 @@ def get_random_filename(extn=None, content_type=None):
@frappe.whitelist()
def validate_filename(filename):
fname = get_file_name(filename, hashlib.md5(filename).hexdigest()[-6:])
hash_ = get_content_hash(filename)
fname = get_file_name(filename, hash_[-6:])
return fname