Photo.rename new_path.assert_not_exists.

master
voussoir 2020-02-19 23:12:29 -08:00
parent 00a443eec3
commit f99d3d03d9
1 changed files with 2 additions and 0 deletions

View File

@ -1009,6 +1009,8 @@ class Photo(ObjectBase):
if new_path.absolute_path == old_path.absolute_path: if new_path.absolute_path == old_path.absolute_path:
raise ValueError('The new and old names are the same') raise ValueError('The new and old names are the same')
new_path.assert_not_exists()
os.makedirs(new_path.parent.absolute_path, exist_ok=True) os.makedirs(new_path.parent.absolute_path, exist_ok=True)
if new_path.normcase != old_path.normcase: if new_path.normcase != old_path.normcase: