jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/805484 )

Change subject: Fix Flow board topic continuation when iterating in reverse
......................................................................

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(-)

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



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 https://gerrit.wikimedia.org/r/c/pywikibot/core/+/805484
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I92e73ba9db284d72c9e08d4ed2fd24c077652d23
Gerrit-Change-Number: 805484
Gerrit-PatchSet: 2
Gerrit-Owner: Happy5214 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to