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.
This commit is contained in:
voussoir 2018-05-03 18:20:48 -07:00
parent a0e3e037c1
commit ae46b097e4

View file

@ -819,7 +819,9 @@ class PDBTagMixin:
def get_tag_by_name(self, tagname): def get_tag_by_name(self, tagname):
if isinstance(tagname, objects.Tag): if isinstance(tagname, objects.Tag):
tagname = tagname.name if tagname.photodb == self:
return tagname
tagname = tagname.tagname
tagname = tagname.strip('.+') tagname = tagname.strip('.+')
tagname = tagname.split('.')[-1].split('+')[0] tagname = tagname.split('.')[-1].split('+')[0]