Skip to content

Commit

Permalink
Use the same template for TestRun emails on create/update
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Feb 19, 2018
1 parent 56d3a65 commit a682c79
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 60 deletions.
Binary file modified tcms/locale/de_DE/LC_MESSAGES/django.mo
Binary file not shown.
39 changes: 37 additions & 2 deletions tcms/locale/de_DE/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kiwitcms\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-14 21:20+0000\n"
"POT-Creation-Date: 2018-02-15 22:47+0000\n"
"PO-Revision-Date: 2018-01-19 03:01-0500\n"
"Last-Translator: atodorov <[email protected]>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -73,10 +73,45 @@ msgstr "Benutzerfehler."
msgid "A user with that username already exists."
msgstr "Es gibt bereits einen Benutzer mit diesem Namen."

#: tcms/signals.py:59
#: tcms/signals.py:80
msgid "New user awaiting approval"
msgstr ""

#: tcms/signals.py:140
#, python-format
msgid "New TestRun %(summary)s created"
msgstr ""

#: tcms/signals.py:142
#, python-format
msgid "TestRun %(summary)s has been updated"
msgstr ""

#: tcms/templates/email/post_run_save/email.txt:2
#, python-format
msgid ""
"Test run %(test_run.pk)s has been created or updated for you.\n"
"\n"
"### Links ###\n"
"Test run: %(test_run.get_url)s\n"
"Test plan: %(test_run.plan.get_url)s\n"
"\n"
"### Basic run information ###\n"
"Summary: %(test_run.summary)s\n"
"\n"
"Managed: %(test_run.manager)s.\n"
"Default tester: %(test_run.default_tester)s.\n"
"\n"
"Product: %(test_run.build.product)s\n"
"Product version: %(test_run.product_version)s\n"
"Build: %(test_run.build)s\n"
"\n"
"Estimated time: %(test_run.estimated_time)s\n"
"\n"
"Notes:\n"
"%(test_run.notes)s\n"
msgstr ""

#: tcms/templates/email/user_registered/notify_admins.txt:2
#, python-format
msgid ""
Expand Down
Binary file modified tcms/locale/en/LC_MESSAGES/django.mo
Binary file not shown.
39 changes: 37 additions & 2 deletions tcms/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-14 21:20+0000\n"
"POT-Creation-Date: 2018-02-15 22:47+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -74,10 +74,45 @@ msgstr ""
msgid "A user with that username already exists."
msgstr ""

#: tcms/signals.py:59
#: tcms/signals.py:80
msgid "New user awaiting approval"
msgstr ""

#: tcms/signals.py:140
#, python-format
msgid "New TestRun %(summary)s created"
msgstr ""

#: tcms/signals.py:142
#, python-format
msgid "TestRun %(summary)s has been updated"
msgstr ""

#: tcms/templates/email/post_run_save/email.txt:2
#, python-format
msgid ""
"Test run %(test_run.pk)s has been created or updated for you.\n"
"\n"
"### Links ###\n"
"Test run: %(test_run.get_url)s\n"
"Test plan: %(test_run.plan.get_url)s\n"
"\n"
"### Basic run information ###\n"
"Summary: %(test_run.summary)s\n"
"\n"
"Managed: %(test_run.manager)s.\n"
"Default tester: %(test_run.default_tester)s.\n"
"\n"
"Product: %(test_run.build.product)s\n"
"Product version: %(test_run.product_version)s\n"
"Build: %(test_run.build)s\n"
"\n"
"Estimated time: %(test_run.estimated_time)s\n"
"\n"
"Notes:\n"
"%(test_run.notes)s\n"
msgstr ""

#: tcms/templates/email/user_registered/notify_admins.txt:2
#, python-format
msgid ""
Expand Down
Binary file modified tcms/locale/zh_CN/LC_MESSAGES/django.mo
Binary file not shown.
39 changes: 37 additions & 2 deletions tcms/locale/zh_CN/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kiwitcms\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-14 21:20+0000\n"
"POT-Creation-Date: 2018-02-15 22:47+0000\n"
"PO-Revision-Date: 2018-01-19 03:01-0500\n"
"Last-Translator: atodorov <[email protected]>\n"
"Language-Team: Chinese Simplified\n"
Expand Down Expand Up @@ -72,10 +72,45 @@ msgstr ""
msgid "A user with that username already exists."
msgstr ""

#: tcms/signals.py:59
#: tcms/signals.py:80
msgid "New user awaiting approval"
msgstr ""

#: tcms/signals.py:140
#, python-format
msgid "New TestRun %(summary)s created"
msgstr ""

#: tcms/signals.py:142
#, python-format
msgid "TestRun %(summary)s has been updated"
msgstr ""

#: tcms/templates/email/post_run_save/email.txt:2
#, python-format
msgid ""
"Test run %(test_run.pk)s has been created or updated for you.\n"
"\n"
"### Links ###\n"
"Test run: %(test_run.get_url)s\n"
"Test plan: %(test_run.plan.get_url)s\n"
"\n"
"### Basic run information ###\n"
"Summary: %(test_run.summary)s\n"
"\n"
"Managed: %(test_run.manager)s.\n"
"Default tester: %(test_run.default_tester)s.\n"
"\n"
"Product: %(test_run.build.product)s\n"
"Product version: %(test_run.product_version)s\n"
"Build: %(test_run.build)s\n"
"\n"
"Estimated time: %(test_run.estimated_time)s\n"
"\n"
"Notes:\n"
"%(test_run.notes)s\n"
msgstr ""

#: tcms/templates/email/user_registered/notify_admins.txt:2
#, python-format
msgid ""
Expand Down
Binary file modified tcms/locale/zh_TW/LC_MESSAGES/django.mo
Binary file not shown.
39 changes: 37 additions & 2 deletions tcms/locale/zh_TW/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kiwitcms\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-14 21:20+0000\n"
"POT-Creation-Date: 2018-02-15 22:47+0000\n"
"PO-Revision-Date: 2018-01-19 03:01-0500\n"
"Last-Translator: atodorov <[email protected]>\n"
"Language-Team: Chinese Traditional\n"
Expand Down Expand Up @@ -72,10 +72,45 @@ msgstr ""
msgid "A user with that username already exists."
msgstr ""

#: tcms/signals.py:59
#: tcms/signals.py:80
msgid "New user awaiting approval"
msgstr ""

#: tcms/signals.py:140
#, python-format
msgid "New TestRun %(summary)s created"
msgstr ""

#: tcms/signals.py:142
#, python-format
msgid "TestRun %(summary)s has been updated"
msgstr ""

#: tcms/templates/email/post_run_save/email.txt:2
#, python-format
msgid ""
"Test run %(test_run.pk)s has been created or updated for you.\n"
"\n"
"### Links ###\n"
"Test run: %(test_run.get_url)s\n"
"Test plan: %(test_run.plan.get_url)s\n"
"\n"
"### Basic run information ###\n"
"Summary: %(test_run.summary)s\n"
"\n"
"Managed: %(test_run.manager)s.\n"
"Default tester: %(test_run.default_tester)s.\n"
"\n"
"Product: %(test_run.build.product)s\n"
"Product version: %(test_run.product_version)s\n"
"Build: %(test_run.build)s\n"
"\n"
"Estimated time: %(test_run.estimated_time)s\n"
"\n"
"Notes:\n"
"%(test_run.notes)s\n"
msgstr ""

#: tcms/templates/email/user_registered/notify_admins.txt:2
#, python-format
msgid ""
Expand Down
24 changes: 10 additions & 14 deletions tcms/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,20 @@ def handle_emails_post_run_save(sender, *args, **kwargs):
"""
Send email updates after a TestRus has been created or updated!
"""
from django.utils.translation import gettext as _

instance = kwargs['instance']

if kwargs.get('created'):
instance.mail(
template='mail/new_run.txt',
subject='New run create from plan %s: %s' % (
instance.plan_id, instance.summary
),
context={'test_run': instance, }
)
subject = _('New TestRun %(summary)s created') % {'summary': instance.summary}
else:
instance.mail(
template='mail/update_run.txt',
subject='Test Run %s - %s has been updated' % (
instance.pk, instance.summary
),
context={'test_run': instance, }
)
subject = _('TestRun %(summary)s has been updated') % {'summary': instance.summary}

instance.mail(
template='email/post_run_save/email.txt',
subject=subject,
context={'test_run': instance}
)


def handle_post_case_run_save(sender, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% load extra_filters %}A new test run has been created for you.
{% load i18n %}
{% blocktrans %}Test run {{ test_run.pk }} has been created or updated for you.

### Links ###
Test run: {{ test_run.get_url }}
{# Test plan: {{ test_run.plan.get_url }} #}
Test plan: {{ test_run.plan.get_url }}

### Basic run information ###
Summary: {{ test_run.summary }}
Expand All @@ -18,11 +19,4 @@ Estimated time: {{ test_run.estimated_time }}

Notes:
{{ test_run.notes }}

### Test plan information ###
Test Plan: {{ test_run.plan }}
{% comment %}
### Test cases information ###
{% for tcr in test_run.case_run.select_related.all %}* {{ tcr.case.summary }}
{% endfor %}
{% endcomment %}
{% endblocktrans %}
28 changes: 0 additions & 28 deletions tcms/templates/mail/update_run.txt

This file was deleted.

0 comments on commit a682c79

Please sign in to comment.