jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1326324?usp=email )
Change subject: datasite: Reuse qualifier snak type
......................................................................
datasite: Reuse qualifier snak type
Retrieve the qualifier snak type once while building the API request.
Reuse it for value serialization and the snaktype parameter.
Change-Id: I98e16e9c928000dda7c9dccc292bbdf86e4f4398
---
M pywikibot/site/_datasite.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site/_datasite.py b/pywikibot/site/_datasite.py
index abd3a52..aa2545d 100644
--- a/pywikibot/site/_datasite.py
+++ b/pywikibot/site/_datasite.py
@@ -573,10 +573,11 @@
params['snakhash'] = qualifier.hash
# build up the snak
- if qualifier.getSnakType() == 'value':
+ snaktype = qualifier.getSnakType()
+ if snaktype == 'value':
params['value'] = json.dumps(qualifier._formatValue())
- params['snaktype'] = qualifier.getSnakType()
+ params['snaktype'] = snaktype
params['property'] = qualifier.getID()
req = self.simple_request(**params)
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1326324?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I98e16e9c928000dda7c9dccc292bbdf86e4f4398
Gerrit-Change-Number: 1326324
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]