[hotfix] encode path before removing file
This commit is contained in:
parent
11fe7e24e4
commit
aef6baf798
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue