canonical-ubuntu-qa team mailing list archive
-
canonical-ubuntu-qa team
-
Mailing list archive
-
Message #01053
[Merge] ~andersson123/autopkgtest-cloud:invalid_function_hotfix into autopkgtest-cloud:master
Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:invalid_function_hotfix into autopkgtest-cloud:master.
Requested reviews:
Canonical's Ubuntu QA (canonical-ubuntu-qa)
For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/447538
--
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:invalid_function_hotfix into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-web/webcontrol/request/app.py b/charms/focal/autopkgtest-web/webcontrol/request/app.py
index beeb22d..8ad5270 100644
--- a/charms/focal/autopkgtest-web/webcontrol/request/app.py
+++ b/charms/focal/autopkgtest-web/webcontrol/request/app.py
@@ -84,12 +84,13 @@ def check_github_sig(request):
return False
-def invalid(message, code=400):
+def invalid(inv_exception, code=400):
"""Return message and HTTP error code for an invalid request and log it"""
if "nickname" in session:
html = LOGOUT.format(**session)
else:
html = ""
+ message = str(inv_exception)
if "\n" not in message:
html += "<p>You submitted an invalid request: %s</p>" % maybe_escape(
str(message)