jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Fix Flow board topic continuation when iterating in reverse

This commit checks for both 'fwd' and 'rev' link forms, failing if
neither is found.

Bug: T138323
Change-Id: I92e73ba9db284d72c9e08d4ed2fd24c077652d23
---
M pywikibot/flow.py
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pywikibot/flow.py b/pywikibot/flow.py
index 3cc747a..71cc206 100644
--- a/pywikibot/flow.py
+++ b/pywikibot/flow.py
@@ -91,7 +91,12 @@

def _parse_url(self, links: Mapping[str, Any]) -> Dict[str, Any]:
"""Parse a URL retrieved from the API."""
- rule = links['fwd']
+ if 'fwd' in links:
+ rule = links['fwd']
+ elif 'rev' in links:
+ rule = links['rev']
+ else:
+ raise ValueError('Illegal board data (missing required data).')
parsed_url = urlparse(rule['url'])
params = parse_qs(parsed_url.query)
new_params = {} # type: Dict[str, Any]

To view, visit change 805484. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I92e73ba9db284d72c9e08d4ed2fd24c077652d23
Gerrit-Change-Number: 805484
Gerrit-PatchSet: 2
Gerrit-Owner: Happy5214 <happy5214@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged