mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-11 09:45:27 +00:00
Removed TODOs. When data is invalid return None.
This commit is contained in:
parent
767cd14639
commit
0f2c0c034d
1 changed files with 1 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue