~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/model/potemplate.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-26 13:06:33 UTC
  • mfrom: (14024.1.2 855150-no-potemplate-mail)
  • Revision ID: launchpad@pqm.canonical.com-20110926130633-taywahokm0z57820
[r=danilo][bug=855150] stop sending "you uploaded a translation
        template" mails

Show diffs side-by-side

added added

removed removed

Lines of Context:
932
932
 
933
933
        rosetta_experts = getUtility(ILaunchpadCelebrities).rosetta_experts
934
934
        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
939
        errors, warnings = None, None
937
940
        try:
938
941
            errors, warnings = translation_importer.importFile(
1010
1013
                        logger.warn(
1011
1014
                            "Statistics update failed: %s" % unicode(error))
1012
1015
 
1013
 
        template = helpers.get_email_template(template_mail, 'translations')
1014
 
        message = template % replacements
1015
 
        return (subject, message)
 
1016
        if template_mail is not None:
 
1017
            template = helpers.get_email_template(
 
1018
                template_mail, 'translations')
 
1019
            message = template % replacements
 
1020
            return (subject, message)
 
1021
        else:
 
1022
            return None, None
1016
1023
 
1017
1024
    def getTranslationRows(self):
1018
1025
        """See `IPOTemplate`."""