Photo.move_file assert new path doesn't exist yet.
This commit is contained in:
parent
1375d9fb26
commit
9e0051ca9c
1 changed files with 3 additions and 2 deletions
|
@ -924,8 +924,9 @@ class Photo(ObjectBase):
|
||||||
def move_file(self, directory, commit=True):
|
def move_file(self, directory, commit=True):
|
||||||
directory = pathclass.Path(directory)
|
directory = pathclass.Path(directory)
|
||||||
directory.assert_is_directory()
|
directory.assert_is_directory()
|
||||||
new_path = directory.with_child(self.real_path.basename).absolute_path
|
new_path = directory.with_child(self.real_path.basename)
|
||||||
self.rename_file(new_path, move=True, commit=commit)
|
new_path.assert_not_exists()
|
||||||
|
self.rename_file(new_path.absolute_path, move=True, commit=commit)
|
||||||
|
|
||||||
#@decorators.time_me
|
#@decorators.time_me
|
||||||
@decorators.required_feature('photo.reload_metadata')
|
@decorators.required_feature('photo.reload_metadata')
|
||||||
|
|
Loading…
Reference in a new issue