[MediaWiki-commits] [Gerrit] pywikibot...FLOSSbot[master]: plugin: ignore empty labels

2016-10-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

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 
---
M FLOSSbot/plugin.py
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Dachary: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I37173b12ca6d63cb47601d09909755e6dcf5eb74
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary 
Gerrit-Reviewer: Dachary 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] pywikibot...FLOSSbot[master]: plugin: ignore empty labels

2016-10-18 Thread Dachary (Code Review)
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 
---
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 

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