← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] ~hyask/autopkgtest-cloud:skia/fix_user_page_indexerror into autopkgtest-cloud:master

 

Skia has proposed merging ~hyask/autopkgtest-cloud:skia/fix_user_page_indexerror into autopkgtest-cloud:master.

Requested reviews:
  Canonical's Ubuntu QA (canonical-ubuntu-qa)

For more details, see:
https://code.launchpad.net/~hyask/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/471405

Small fix for user page to avoid failing when `private job` are queued.
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~hyask/autopkgtest-cloud:skia/fix_user_page_indexerror into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-web/webcontrol/browse.cgi b/charms/focal/autopkgtest-web/webcontrol/browse.cgi
index c8081c2..e942f7c 100755
--- a/charms/focal/autopkgtest-web/webcontrol/browse.cgi
+++ b/charms/focal/autopkgtest-web/webcontrol/browse.cgi
@@ -383,7 +383,8 @@ def get_queued_for_user(user: str):
                 for req in requests:
                     try:
                         req_info = json.loads(req.split("\n")[1])
-                    except json.JSONDecodeError as _:
+                    except (json.JSONDecodeError, IndexError):
+                        # These usually result from `private job` instances
                         continue
                     package = req.split("\n")[0]
                     if req_info.get("requester", "") == user: