From cc0c847eb55292801da0ec04f859b385777c8491 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 20 Apr 2017 18:28:11 -0700 Subject: [PATCH] Make sure easybake uses the normalized name in return notes. --- etiquette/objects.py | 2 ++ etiquette/photodb.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index 1e788e1..e7c8bae 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -929,6 +929,8 @@ class Tag(ObjectBase, GroupableMixin): self.photodb.log.debug('Committing - add synonym') self.photodb.commit() + return synname + def convert_to_synonym(self, mastertag, *, commit=True): ''' Convert this tag into a synonym for a different tag. diff --git a/etiquette/photodb.py b/etiquette/photodb.py index e5e48a1..d57b977 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -1354,8 +1354,9 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs if rename_to: tag = self.get_tag(tag) - note = ('rename', '%s=%s' % (tag.name, rename_to)) + old_name = tag.name tag.rename(rename_to) + note = ('rename', '%s=%s' % (old_name, tag.name)) output_notes.append(note) else: tag_parts = tag.split('.') @@ -1370,7 +1371,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs tag = tags[-1] if synonym: - tag.add_synonym(synonym) + synonym = tag.add_synonym(synonym) note = ('new_synonym', '%s+%s' % (tag.name, synonym)) output_notes.append(note) print('New syn %s' % synonym)