diff --git a/etiquette/objects.py b/etiquette/objects.py index ee32f2e..ea239cf 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -1059,23 +1059,19 @@ class Photo(ObjectBase): @decorators.required_feature('photo.edit') @decorators.transaction - def relocate(self, new_filepath, *, allow_duplicates=False): + def relocate(self, new_filepath): ''' Point the Photo object to a different filepath. DOES NOT MOVE THE FILE, only acknowledges a move that was performed outside of the system. To rename or move the file, use `rename_file`. - - allow_duplicates: - Allow even if there is another Photo for that path. ''' new_filepath = pathclass.Path(new_filepath) if not new_filepath.is_file: raise FileNotFoundError(new_filepath.absolute_path) - if not allow_duplicates: - self.photodb.assert_no_such_photo_by_path(filepath=new_filepath) + self.photodb.assert_no_such_photo_by_path(filepath=new_filepath) self.photodb.log.debug('Relocating %s to "%s"', self, new_filepath.absolute_path) data = { diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 673efe1..992c85c 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -456,7 +456,6 @@ class PDBPhotoMixin: self, filepath, *, - allow_duplicates=False, author=None, do_metadata=True, do_thumbnail=True, @@ -467,9 +466,6 @@ class PDBPhotoMixin: Given a filepath, determine its attributes and create a new Photo object in the database. Tags may be applied now or later. - If `allow_duplicates` is False, we will first check the database for any - files with the same path and raise exceptions.PhotoExists if found. - Returns the Photo object. ''' # These might raise exceptions @@ -477,8 +473,7 @@ class PDBPhotoMixin: if not filepath.is_file: raise FileNotFoundError(filepath.absolute_path) - if not allow_duplicates: - self.assert_no_such_photo_by_path(filepath=filepath) + self.assert_no_such_photo_by_path(filepath=filepath) author_id = self.get_user_id_or_none(author)