From cd7fce808e60c09d184b7ec7e72570494a87d399 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 22 Jun 2020 14:29:06 -0700 Subject: be more careful with sherpa/romeo color summarization --- chocula/database.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chocula/database.py b/chocula/database.py index c7fee47..a27a560 100644 --- a/chocula/database.py +++ b/chocula/database.py @@ -503,9 +503,10 @@ class ChoculaDatabase: ezb_extra = json.loads(irow["extra"]) if irow["slug"] == "sherpa_romeo": extra = json.loads(irow["extra"]) - out["sherpa_color"] = extra["sherpa_romeo"]["color"] - if extra["sherpa_romeo"]["color"] == "green": - out["is_oa"] = True + if extra.get("sherpa_romeo"): + out["sherpa_color"] = extra["sherpa_romeo"]["color"] + if extra["sherpa_romeo"].get("color") == "green": + out["is_oa"] = True # filter out "NA" ISSNs for k in ("issne", "issnp"): -- cgit v1.2.3