[hotfix] encode path before removing file

This commit is contained in:
Anand Doshi 2015-03-31 13:07:29 +05:30
parent 11fe7e24e4
commit aef6baf798

View file

@ -228,10 +228,14 @@ def delete_file_data_content(doc):
def delete_file_from_filesystem(doc):
path = doc.file_name
if path.startswith("files/"):
path = frappe.utils.get_site_path("public", doc.file_name)
else:
path = frappe.utils.get_site_path("public", "files", doc.file_name)
path = encode(path)
if os.path.exists(path):
os.remove(path)