jenkins-bot has submitted this change and it was merged.
Change subject: Fix edit conflicts after calls to save_claim()
......................................................................
Fix edit conflicts after calls to save_claim()
Unlike DataSite.addClaim(), DataSite.save_claim() was not updating
the latest revision ID of the item of the saved claim. As a result,
any submission to Wikidata after modifying a claim, such as
Claim.changeRank(), would result in an edit conflict.
Now DataSite.save_claim() updates the latest revision ID of the
item of the saved claim.
Change-Id: I2079228b50abca2e171bbc63e6bdd581532cd703
---
M pywikibot/site.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index fb92abe..39ac5cb 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -7071,6 +7071,7 @@
req = self._simple_request(**params)
data = req.submit()
+ claim.on_item.latest_revision_id = data['pageinfo']['lastrevid']
return data
@must_be(group='user')
--
To view, visit
https://gerrit.wikimedia.org/r/268877
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2079228b50abca2e171bbc63e6bdd581532cd703
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Gallaecio <adriyetichaves(a)gmail.com>
Gerrit-Reviewer: Gallaecio <adriyetichaves(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>