mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-12 17:15:16 +00:00
Alters get_description code for inventaire queries
This commit is contained in:
parent
3916666897
commit
609b7f58c8
1 changed files with 3 additions and 2 deletions
|
@ -222,9 +222,10 @@ class Connector(AbstractConnector):
|
|||
def get_description(self, links: JsonDict) -> str:
|
||||
"""grab an extracted excerpt from wikipedia"""
|
||||
link = links.get("enwiki")
|
||||
if not link:
|
||||
if not link or not link.get("title"):
|
||||
return ""
|
||||
url = f"{self.base_url}/api/data?action=wp-extract&lang=en&title={link}"
|
||||
title = link.get("title")
|
||||
url = f"{self.base_url}/api/data?action=wp-extract&lang=en&title={title}"
|
||||
try:
|
||||
data = get_data(url)
|
||||
except ConnectorException:
|
||||
|
|
Loading…
Reference in a new issue