web: fix bug reporting link in get_error_page()
We used the ADD_ISSUE_LINK constant variable URL from two places. At one, we forgot appending `?body=`. Add it by calling into the same function that builds the URL once. Drop the constant URL now that it is consumed from a single place. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
This commit is contained in:
parent
fd03fb1ed0
commit
e25dc5e6ee
1 changed files with 2 additions and 3 deletions
|
|
@ -43,7 +43,6 @@ from .web_utils import ProjectConverter, IdentConverter, validate_version, valid
|
||||||
get_elixir_version_string, get_elixir_repo_url, RequestContext, Config
|
get_elixir_version_string, get_elixir_repo_url, RequestContext, Config
|
||||||
|
|
||||||
VERSION_CACHE_DURATION_SECONDS = 2 * 60 # 2 minutes
|
VERSION_CACHE_DURATION_SECONDS = 2 * 60 # 2 minutes
|
||||||
ADD_ISSUE_LINK = "https://github.com/bootlin/elixir/issues/new"
|
|
||||||
ELIXIR_VERSION_STRING = get_elixir_version_string()
|
ELIXIR_VERSION_STRING = get_elixir_version_string()
|
||||||
ELIXIR_REPO_LINK = get_elixir_repo_url(ELIXIR_VERSION_STRING)
|
ELIXIR_REPO_LINK = get_elixir_repo_url(ELIXIR_VERSION_STRING)
|
||||||
|
|
||||||
|
|
@ -76,7 +75,7 @@ def get_github_issue_url(details: str):
|
||||||
"---\n\n" +
|
"---\n\n" +
|
||||||
details)
|
details)
|
||||||
|
|
||||||
return ADD_ISSUE_LINK + "?body=" + parse.quote(body)
|
return "https://github.com/bootlin/elixir/issues/new?body=" + parse.quote(body)
|
||||||
|
|
||||||
|
|
||||||
# Generate an error page from ElixirProjectError
|
# Generate an error page from ElixirProjectError
|
||||||
|
|
@ -157,7 +156,7 @@ def get_error_page(req, resp, exception: ElixirProjectError):
|
||||||
'source_base_url': '/',
|
'source_base_url': '/',
|
||||||
|
|
||||||
'referer': req.referer,
|
'referer': req.referer,
|
||||||
'bug_report_url': ADD_ISSUE_LINK + parse.quote(report_error_details),
|
'bug_report_url': get_github_issue_url(report_error_details),
|
||||||
'report_error_details': report_error_details,
|
'report_error_details': report_error_details,
|
||||||
|
|
||||||
'error_title': exception.title,
|
'error_title': exception.title,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue