Dachary has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316576

Change subject: plugin: ignore empty labels
......................................................................

plugin: ignore empty labels

When looking for an entity by a designated name.

Change-Id: I37173b12ca6d63cb47601d09909755e6dcf5eb74
Signed-off-by: Loic Dachary <l...@dachary.org>
---
M FLOSSbot/plugin.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/FLOSSbot 
refs/changes/76/316576/1

diff --git a/FLOSSbot/plugin.py b/FLOSSbot/plugin.py
index d5664bc..ec770fa 100644
--- a/FLOSSbot/plugin.py
+++ b/FLOSSbot/plugin.py
@@ -121,7 +121,8 @@
         candidates = []
         for p in site.search_entities(name, 'en', **kwargs):
             log.debug("looking for entity " + name + ", found " + str(p))
-            if (Plugin.normalize_name(p.get('label')) ==
+            if ('label' in p and
+                    Plugin.normalize_name(p['label']) ==
                     Plugin.normalize_name(name)):
                 if kwargs['type'] == 'property':
                     candidates.append(p)

-- 
To view, visit https://gerrit.wikimedia.org/r/316576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I37173b12ca6d63cb47601d09909755e6dcf5eb74
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary <l...@dachary.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to