From ae46b097e4c061f3b749c2960553917780677f56 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 3 May 2018 18:20:48 -0700 Subject: [PATCH] Let get_tag_by_name return inputted Tag right away. For caller's convenience most functions assume you are passing name as a string, but if you already have the Tag we'll just use it. --- etiquette/photodb.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 62595f5..9ee4dbf 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -819,7 +819,9 @@ class PDBTagMixin: def get_tag_by_name(self, tagname): if isinstance(tagname, objects.Tag): - tagname = tagname.name + if tagname.photodb == self: + return tagname + tagname = tagname.tagname tagname = tagname.strip('.+') tagname = tagname.split('.')[-1].split('+')[0]