fix a problem saving over a deck with an existing media folder

This commit is contained in:
Damien Elmes 2008-12-13 16:44:59 +09:00
parent f1a2fc7feb
commit daeba6f78b

View file

@ -1369,8 +1369,13 @@ Return new path, relative to media dir."""
assert os.path.exists(oldPath)
newPath = self.mediaDir(create=True)
# copytree doesn't want the dir to exist
try:
os.rmdir(newPath)
shutil.copytree(oldPath, newPath)
except:
# FIXME: should really remove everything in old dir instead of
# giving up
pass
# DB helpers
##########################################################################