diff --git a/oml/item/models.py b/oml/item/models.py index a3605b6..13bb27e 100644 --- a/oml/item/models.py +++ b/oml/item/models.py @@ -787,7 +787,11 @@ class File(db.Model): if self.path != new_path: path = os.path.join(prefix, new_path) ox.makedirs(os.path.dirname(path)) - shutil.move(current_path, path) + try: + shutil.move(current_path, path) + except: + logger.debug('failed to move %s to %s', current_path, path, exc_info=True) + return self.path = new_path self.save() for folder in set(os.path.dirname(p) for p in [current_path, path]):