Merge lp:~mbp/launchpad/855150-no-potemplate-mail into lp:launchpad

Proposed by Martin Pool
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 14034
Proposed branch: lp:~mbp/launchpad/855150-no-potemplate-mail
Merge into: lp:launchpad
Diff against target: 61 lines (+13/-18)
2 files modified
lib/lp/translations/doc/poimport.txt (+2/-14)
lib/lp/translations/model/potemplate.py (+11/-4)
To merge this branch: bzr merge lp:~mbp/launchpad/855150-no-potemplate-mail
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Launchpad code reviewers Pending
Review via email: mp+76878@code.launchpad.net

Commit message

[r=danilo][bug=855150] stop sending "you uploaded a translation template" mails

Description of the change

This just stops sending "you uploaded a translation template for bzr in Bazaar trunk in Launchpad" mails when potemplates are imported. At the moment they are sent to a large group of people, most of whom likely see this as spam (in the case I looked at.)

I don't know if there are other people who do like getting these mails or count on getting them to know things are working properly. I doubt they are very useful because there's so little content. Possibly we want some in-web view of when templates were imported (if it's not already obvious) or some way for people to opt-in to get mail about it, but in the absence of that this still seems like a step forward.

danilos said he thought this was a reasonable step.

No tests fail in the subset I ran.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

Actually, there was a test for this, which failed on ec2. I'll update it.

Revision history for this message
Данило Шеган (danilo) wrote :

Looks good, thanks for fixing this (actually bug 353648).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/doc/poimport.txt'
2--- lib/lp/translations/doc/poimport.txt 2011-05-27 19:53:20 +0000
3+++ lib/lp/translations/doc/poimport.txt 2011-09-26 06:52:27 +0000
4@@ -133,22 +133,10 @@
5 >>> potemplate.date_last_updated > saved_date
6 True
7
8-A successful import is confirmed by email.
9+We don't send mail about successful imports.
10
11 >>> print subject
12- Translation template import - ...
13-
14- >>> print body
15- Hello Mark Shuttleworth,
16- <BLANKLINE>
17- On ..., you uploaded a translation
18- template for ... in Launchpad.
19- <BLANKLINE>
20- The template has now been imported successfully.
21- <BLANKLINE>
22- Thank you,
23- <BLANKLINE>
24- The Launchpad team
25+ None
26
27 Since there was no error, the queue entry's error_output is blank.
28
29
30=== modified file 'lib/lp/translations/model/potemplate.py'
31--- lib/lp/translations/model/potemplate.py 2011-09-15 11:35:28 +0000
32+++ lib/lp/translations/model/potemplate.py 2011-09-26 06:52:27 +0000
33@@ -932,7 +932,10 @@
34
35 rosetta_experts = getUtility(ILaunchpadCelebrities).rosetta_experts
36 subject = 'Translation template import - %s' % self.displayname
37- template_mail = 'poimport-template-confirmation.txt'
38+ # Can use template_mail = 'poimport-template-confirmation.txt' to send
39+ # mail when everything is imported, but those mails aren't very useful
40+ # to or much welcomed by the recipients. See bug 855150.
41+ template_mail = None
42 errors, warnings = None, None
43 try:
44 errors, warnings = translation_importer.importFile(
45@@ -1010,9 +1013,13 @@
46 logger.warn(
47 "Statistics update failed: %s" % unicode(error))
48
49- template = helpers.get_email_template(template_mail, 'translations')
50- message = template % replacements
51- return (subject, message)
52+ if template_mail is not None:
53+ template = helpers.get_email_template(
54+ template_mail, 'translations')
55+ message = template % replacements
56+ return (subject, message)
57+ else:
58+ return None, None
59
60 def getTranslationRows(self):
61 """See `IPOTemplate`."""