From 0f2c0c034db515cb8201d09143fb264797e6d6e7 Mon Sep 17 00:00:00 2001 From: Joeri de Ruiter Date: Mon, 21 Aug 2023 13:28:08 +0200 Subject: [PATCH] Removed TODOs. When data is invalid return None. --- bookwyrm/utils/isni.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bookwyrm/utils/isni.py b/bookwyrm/utils/isni.py index 6c4200660..e3b2c65f3 100644 --- a/bookwyrm/utils/isni.py +++ b/bookwyrm/utils/isni.py @@ -165,8 +165,6 @@ def get_author_from_isni(isni: str) -> Optional[activitypub.Author]: # but let's use the first one just in case element = root.find(".//responseRecord") if element is None: - # TODO What if there is no responseRecord? - # return empty Author or None, or raise Exception? return None name = ( @@ -215,8 +213,7 @@ def augment_author_metadata(author: models.Author, isni: str) -> None: isni_author = get_author_from_isni(isni) if isni_author is None: - # TODO Should we just return or raise an exception to indicate a problem? - return + return None isni_author.to_model(model=models.Author, instance=author, overwrite=False)