Adds appropriate object checking to objtag lockfunc (partial fix for #2227).

This commit is contained in:
Johnny 2020-10-11 23:18:02 +00:00
parent ea6f245f56
commit 11cf5ada87

View file

@ -539,6 +539,8 @@ def objtag(accessing_obj, accessed_obj, *args, **kwargs):
Only true if accessed_obj has the specified tag and optional
category.
"""
if hasattr(accessed_obj, "obj"):
accessed_obj = accessed_obj.obj
tagkey = args[0] if args else None
category = args[1] if len(args) > 1 else None
return bool(accessed_obj.tags.get(tagkey, category=category))