Log an error and continue when a related object is not found

This commit is contained in:
Jeff Bradberry 2020-04-23 11:11:35 -04:00
parent 66bc947adb
commit 57aff6394c

View File

@ -286,7 +286,9 @@ class ApiV2(base.Base):
def _assign_related_assets(self, assets):
for asset in assets:
_page = self._get_by_natural_key(asset['natural_key'])
# FIXME: deal with `_page is None` case
if _page is None:
log.error("Related object with natural key not found: %r", asset['natural_key'])
continue
for name, S in asset.get('related', {}).items():
if not S:
continue