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:
parent
a0e3e037c1
commit
ae46b097e4
1 changed files with 3 additions and 1 deletions
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue