Skip to content

Commit

Permalink
fix: copy, not move
Browse files Browse the repository at this point in the history
  • Loading branch information
safwansamsudeen committed Feb 14, 2025
1 parent 5fde4f1 commit 6188a85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drive/patches/team_restructure.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import frappe
from pathlib import Path
import shutil


def execute():
Expand Down Expand Up @@ -33,9 +34,9 @@ def execute():
doc.path = home_folder + "/" + "/".join(path_els[path_els.index("files") + 2 :])
p = Path(k["path"])
try:
p.rename(Path(frappe.get_site_path("private/files")) /doc.path)
shutil.copy(str(p), str(Path(frappe.get_site_path("private/files")) /doc.path))
except:
print('Moving failed for', doc.path, '-', Path(frappe.get_site_path("private/files")) /( doc.path))
print('Moving failed for', str(p), '->', Path(frappe.get_site_path("private/files")) /( doc.path))
doc.insert()

translate[k["old_name"]] = doc.name
Expand Down

0 comments on commit 6188a85

Please sign in to comment.