Handle deleted item for human
This commit is contained in:
parent
60bb9febd9
commit
cb3a9396de
|
@ -39,7 +39,7 @@ def from_name(name):
|
||||||
|
|
||||||
found = []
|
found = []
|
||||||
for entity in mediawiki.get_entities_with_cache(qids, props='labels|descriptions'):
|
for entity in mediawiki.get_entities_with_cache(qids, props='labels|descriptions'):
|
||||||
if 'redirects' in entity:
|
if 'redirects' in entity or 'missing' in entity:
|
||||||
continue
|
continue
|
||||||
qid = entity['id']
|
qid = entity['id']
|
||||||
item = lookup[qid]
|
item = lookup[qid]
|
||||||
|
@ -51,7 +51,7 @@ def from_name(name):
|
||||||
label = wikibase.get_entity_label(entity)
|
label = wikibase.get_entity_label(entity)
|
||||||
if label:
|
if label:
|
||||||
i['label'] = label
|
i['label'] = label
|
||||||
if 'en' in entity['descriptions']:
|
if 'en' in entity.get('descriptions', {}):
|
||||||
i['description'] = entity['descriptions']['en']['value']
|
i['description'] = entity['descriptions']['en']['value']
|
||||||
found.append(i)
|
found.append(i)
|
||||||
found.sort(key=lambda i: i.get('label', ''))
|
found.sort(key=lambda i: i.get('label', ''))
|
||||||
|
|
Loading…
Reference in a new issue