Photo.rename new_path.assert_not_exists.

This commit is contained in:
voussoir 2020-02-19 23:12:29 -08:00
parent 00a443eec3
commit f99d3d03d9

View file

@ -1009,6 +1009,8 @@ class Photo(ObjectBase):
if new_path.absolute_path == old_path.absolute_path:
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)
if new_path.normcase != old_path.normcase: