From 8b9ef2a492eb74be0fda53532e149174f7b01b09 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 25 Feb 2018 18:56:11 -0800 Subject: [PATCH] Oops, add commit parameter to Photo.copy_tags. --- etiquette/objects.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index 738a0ff..dedfa36 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -631,12 +631,15 @@ class Photo(ObjectBase): @decorators.required_feature('photo.add_remove_tag') # 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. ''' 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.transaction