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
=== modified file 'lib/lp/translations/doc/poimport.txt'
--- lib/lp/translations/doc/poimport.txt 2011-05-27 19:53:20 +0000
+++ lib/lp/translations/doc/poimport.txt 2011-09-26 06:52:27 +0000
@@ -133,22 +133,10 @@
133 >>> potemplate.date_last_updated > saved_date133 >>> potemplate.date_last_updated > saved_date
134 True134 True
135135
136A successful import is confirmed by email.136We don't send mail about successful imports.
137137
138 >>> print subject138 >>> print subject
139 Translation template import - ...139 None
140
141 >>> print body
142 Hello Mark Shuttleworth,
143 <BLANKLINE>
144 On ..., you uploaded a translation
145 template for ... in Launchpad.
146 <BLANKLINE>
147 The template has now been imported successfully.
148 <BLANKLINE>
149 Thank you,
150 <BLANKLINE>
151 The Launchpad team
152140
153Since there was no error, the queue entry's error_output is blank.141Since there was no error, the queue entry's error_output is blank.
154142
155143
=== modified file 'lib/lp/translations/model/potemplate.py'
--- lib/lp/translations/model/potemplate.py 2011-09-15 11:35:28 +0000
+++ lib/lp/translations/model/potemplate.py 2011-09-26 06:52:27 +0000
@@ -932,7 +932,10 @@
932932
933 rosetta_experts = getUtility(ILaunchpadCelebrities).rosetta_experts933 rosetta_experts = getUtility(ILaunchpadCelebrities).rosetta_experts
934 subject = 'Translation template import - %s' % self.displayname934 subject = 'Translation template import - %s' % self.displayname
935 template_mail = 'poimport-template-confirmation.txt'935 # Can use template_mail = 'poimport-template-confirmation.txt' to send
936 # mail when everything is imported, but those mails aren't very useful
937 # to or much welcomed by the recipients. See bug 855150.
938 template_mail = None
936 errors, warnings = None, None939 errors, warnings = None, None
937 try:940 try:
938 errors, warnings = translation_importer.importFile(941 errors, warnings = translation_importer.importFile(
@@ -1010,9 +1013,13 @@
1010 logger.warn(1013 logger.warn(
1011 "Statistics update failed: %s" % unicode(error))1014 "Statistics update failed: %s" % unicode(error))
10121015
1013 template = helpers.get_email_template(template_mail, 'translations')1016 if template_mail is not None:
1014 message = template % replacements1017 template = helpers.get_email_template(
1015 return (subject, message)1018 template_mail, 'translations')
1019 message = template % replacements
1020 return (subject, message)
1021 else:
1022 return None, None
10161023
1017 def getTranslationRows(self):1024 def getTranslationRows(self):
1018 """See `IPOTemplate`."""1025 """See `IPOTemplate`."""