Skip to content

Commit 39863d7

Browse files
authored
Merge pull request #2959 from kobotoolbox/2750-Point-URL-in-REST-submission-email-notification-to-submission-list
Fix to point the URL in the REST submission email to the correct screen in the UI
2 parents 73271f9 + 558bf2a commit 39863d7

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

kobo/apps/hook/tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def failures_reports():
110110
max_length = 0
111111
records[record.hook.asset.owner.id]['assets'][record.hook.asset.uid] = {
112112
'name': record.hook.asset.name,
113+
'hook_uid': record.hook.uid,
113114
'max_length': 0,
114115
'logs': []
115116
}

kobo/apps/hook/templates/reports/failures_email_body.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
{% for asset_uid, asset in assets.items %}
1414
{% url 'api_v2:asset-detail' uid=asset_uid as asset_url %}
15-
<p>{{ i18n_asset }}: <b><a href="{{ kpi_base_url }}{{ asset_url }}">{{ asset.name }}</a></b></p>
15+
<p>{{ i18n_asset }}: <b><a href="{{ kpi_base_url }}/#/forms/{{asset_uid}}/settings/rest/{{asset.hook_uid}}">{{ asset.name }}</a></b></p>
1616
<table>
1717
<tr>
1818
<th style="border-bottom:1px solid black;">{{ i18n_hook }}</th>

kobo/apps/hook/templates/reports/failures_email_body.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
{% for asset_uid, asset in assets.items %}
1515
{% url 'api_v2:asset-detail' uid=asset_uid as asset_url %}
16-
{{ i18n_asset }}: {{ asset.name }} - [{{ kpi_base_url }}{{ asset_url }}]
16+
{{ i18n_asset }}: {{ asset.name }} - [{{ kpi_base_url }}/#/forms/{{asset_uid}}/settings/rest/{{asset.hook_uid}}]
1717

1818
{% with max_length=asset.max_length|add:"2" %}
1919
{{ i18n_hook|center:max_length }}|{{ i18n_submission|center:25 }}|{{ i18n_status_code|center:15 }}|{{ i18n_message|truncatechars:23|center:25 }}|{{ i18n_date|center:25 }}

kobo/apps/hook/tests/test_email.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def test_notifications(self):
3636
"assets": {
3737
self.asset.uid: {
3838
"name": self.asset.name,
39+
"hook_uid": self.hook.uid,
3940
"max_length": len(self.hook.name),
4041
"logs": [{
4142
"hook_name": self.hook.name,

0 commit comments

Comments
 (0)