Safely handle absent claims field

This commit is contained in:
Mouse Reeve 2021-04-29 10:12:56 -07:00
parent 8d38d1c9d1
commit cfd2c05ae2

View file

@ -65,7 +65,7 @@ class Connector(AbstractConnector):
raise ConnectorException("Invalid book data")
# flatten the data so that images, uri, and claims are on the same level
return {
**data.get("claims"),
**data.get("claims", {}),
**{k: data.get(k) for k in ["uri", "image", "labels"]},
}