DB-API: ignore errors on secondary field lookups

This commit is contained in:
Doug Blank 2016-09-23 19:35:11 -04:00
parent 3b0e04fb78
commit 0ce1a91dec

View File

@ -37,6 +37,7 @@ import time
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from .baseobj import BaseObject from .baseobj import BaseObject
from gramps.gen.errors import HandleError
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -353,7 +354,13 @@ class TableObject(BaseObject):
# start over here: # start over here:
obj = None obj = None
if current: if current:
try:
obj = ptype.join(db, current) obj = ptype.join(db, current)
except HandleError:
if ignore_errors:
obj = None
else:
raise
if part == "self": if part == "self":
current = obj current = obj
path_to = [] path_to = []