Skip to content

Commit 6188a85

Browse files
fix: copy, not move
1 parent 5fde4f1 commit 6188a85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drive/patches/team_restructure.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import frappe
22
from pathlib import Path
3+
import shutil
34

45

56
def execute():
@@ -33,9 +34,9 @@ def execute():
3334
doc.path = home_folder + "/" + "/".join(path_els[path_els.index("files") + 2 :])
3435
p = Path(k["path"])
3536
try:
36-
p.rename(Path(frappe.get_site_path("private/files")) /doc.path)
37+
shutil.copy(str(p), str(Path(frappe.get_site_path("private/files")) /doc.path))
3738
except:
38-
print('Moving failed for', doc.path, '-', Path(frappe.get_site_path("private/files")) /( doc.path))
39+
print('Moving failed for', str(p), '->', Path(frappe.get_site_path("private/files")) /( doc.path))
3940
doc.insert()
4041

4142
translate[k["old_name"]] = doc.name

0 commit comments

Comments
 (0)