aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Casagrande <milo.casagrande@linaro.org>2015-03-31 15:05:09 +0200
committerMilo Casagrande <milo.casagrande@linaro.org>2015-03-31 15:05:25 +0200
commited32f1fe812a2f43dd3d1fafd7774b56e9d08785 (patch)
treef64c78678b0fe646611073174a8866f10ae9605f
parent004d9f8e02384bde7a2bd8c588080e79f482a3d2 (diff)
Use URL translation function in boot email.
-rw-r--r--app/utils/report/boot.py15
-rw-r--r--app/utils/report/templates/boot.html2
-rw-r--r--app/utils/report/templates/boot.txt2
3 files changed, 15 insertions, 4 deletions
diff --git a/app/utils/report/boot.py b/app/utils/report/boot.py
index 7ade822..23e6915 100644
--- a/app/utils/report/boot.py
+++ b/app/utils/report/boot.py
@@ -482,12 +482,23 @@ def _create_boot_email(**kwargs):
kwargs["tree_string"] = G_(u"Tree: %(job)s") % kwargs
kwargs["branch_string"] = G_(u"Branch: %(git_branch)s") % kwargs
kwargs["git_describe_string"] = G_(u"Git Describe: %(kernel)s") % kwargs
- kwargs["git_commit_string"] = G_(u"Git Commit: %(git_commit)s") % kwargs
- kwargs["git_url_string"] = G_(u"Git URL: %(git_url)s") % kwargs
kwargs["info_email"] = info_email
kwargs["tested_string"] = tested_string
kwargs["subject_str"] = subject_str
+ git_url = k_get("git_url")
+ git_commit = k_get("git_commit")
+
+ translated_git_url = \
+ rcommon.translate_git_url(git_url, git_commit) or git_url
+
+ git_txt_string = G_(u"Git URL: %s") % git_url
+ git_html_string = G_(u"Git URL: <a href=\"%s\">%s</a>") % (
+ translated_git_url, git_url)
+
+ kwargs["git_commit_string"] = G_(u"Git Commit: %s") % git_commit
+ kwargs["git_url_string"] = (git_txt_string, git_html_string)
+
kwargs["platforms"] = _parse_and_structure_results(**kwargs)
if models.EMAIL_TXT_FORMAT_KEY in email_format:
diff --git a/app/utils/report/templates/boot.html b/app/utils/report/templates/boot.html
index b5f7907..4eb2637 100644
--- a/app/utils/report/templates/boot.html
+++ b/app/utils/report/templates/boot.html
@@ -16,7 +16,7 @@
<tr><td>{{ branch_string }}</td></tr>
<tr><td>{{ git_describe_string }}</td></tr>
<tr><td>{{ git_commit_string }}</td></tr>
- <tr><td>{{ git_url_string }}</td></tr>
+ <tr><td>{{ git_url_string[1] }}</td></tr>
{%- if tested_string %}
<tr><td>{{ tested_string }}</td></tr>
{%- endif %}
diff --git a/app/utils/report/templates/boot.txt b/app/utils/report/templates/boot.txt
index 29618c4..82eff38 100644
--- a/app/utils/report/templates/boot.txt
+++ b/app/utils/report/templates/boot.txt
@@ -7,7 +7,7 @@
{{ branch_string }}
{{ git_describe_string }}
{{ git_commit_string }}
-{{ git_url_string }}
+{{ git_url_string[0] }}
{%- if tested_string %}
{{ tested_string }}
{% endif %}