chore: use shutil.move instead of Path.rename to move to purgatory

Otherwise it will fail if src and dest are not on the same FS.
This commit is contained in:
Yohan Boniface 2024-10-22 12:14:04 +02:00
parent 85d65c5070
commit c6c255e216

View file

@ -1,6 +1,7 @@
import json
import operator
import os
import shutil
import time
import uuid
from pathlib import Path
@ -498,7 +499,7 @@ class DataLayer(NamedModel):
src = Path(self.geojson.storage.location) / self.storage_root()
for version in self.versions:
name = version["name"]
(src / name).rename(dest / f"{self.map.pk}_{name}")
shutil.move(src / name, dest / f"{self.map.pk}_{name}")
def upload_to(self):
root = self.storage_root()