Oops, add commit parameter to Photo.copy_tags.

This commit is contained in:
voussoir 2018-02-25 18:56:11 -08:00
parent 4ae5f52db3
commit 8b9ef2a492

View file

@ -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