aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-12-17 16:27:53 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-12-17 16:27:53 +0100
commitbe8cac2be49b44a8a1c600dacc1c47c42f12ffc1 (patch)
tree40cd60db8de23ec0c2c2cec124b0fe9439cfc0c9
parent39b35a1274ac7ebdea88d2913bef8d0357063ff3 (diff)
downloadfuzzycat-be8cac2be49b44a8a1c600dacc1c47c42f12ffc1.tar.gz
fuzzycat-be8cac2be49b44a8a1c600dacc1c47c42f12ffc1.zip
check doi existence
-rw-r--r--fuzzycat/verify.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py
index 1cf8f3c..00d76ba 100644
--- a/fuzzycat/verify.py
+++ b/fuzzycat/verify.py
@@ -158,7 +158,9 @@ def verify(a: Dict, b: Dict, min_title_length=5) -> Tuple[str, str]:
# A few items have the same DOI.
try:
- if glom(a, "ext_ids.doi") == glom(b, "ext_ids.doi"):
+ a_doi = glom(a, "ext_ids.doi")
+ b_doi = glom(b, "ext_ids.doi")
+ if a_doi is not None and a_doi == b_doi:
return Verify(Status.EXACT, Reason.DOI)
except PathAccessError:
pass