Oops, add commit parameter to Photo.copy_tags.
This commit is contained in:
parent
4ae5f52db3
commit
8b9ef2a492
1 changed files with 5 additions and 2 deletions
|
@ -631,12 +631,15 @@ class Photo(ObjectBase):
|
||||||
|
|
||||||
@decorators.required_feature('photo.add_remove_tag')
|
@decorators.required_feature('photo.add_remove_tag')
|
||||||
# Photo.add_tag already has @transaction.
|
# Photo.add_tag already has @transaction.
|
||||||
def copy_tags(self, other_photo):
|
def copy_tags(self, other_photo, *, commit=True):
|
||||||
'''
|
'''
|
||||||
Take all of the tags owned by other_photo and apply them to this photo.
|
Take all of the tags owned by other_photo and apply them to this photo.
|
||||||
'''
|
'''
|
||||||
for tag in other_photo.get_tags():
|
for tag in other_photo.get_tags():
|
||||||
self.add_tag(tag)
|
self.add_tag(tag, commit=False)
|
||||||
|
if commit:
|
||||||
|
self.photodb.log.debug('Committing - copy tags')
|
||||||
|
self.photodb.commit()
|
||||||
|
|
||||||
@decorators.required_feature('photo.edit')
|
@decorators.required_feature('photo.edit')
|
||||||
@decorators.transaction
|
@decorators.transaction
|
||||||
|
|
Loading…
Reference in a new issue