~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/codeofconduct.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-15 10:35:32 UTC
  • mfrom: (14517.1.3 new-bzr)
  • Revision ID: launchpad@pqm.canonical.com-20111215103532-q2m4uyk0r8ugiayx
[r=sinzui, poolie][bug=509016] Always load foreign plugins,
 but restrict probers to avoid accidentally opening foreign branches.
 (re-land)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
# pylint: disable-msg=E0611,W0212
215
215
    def sendAdvertisementEmail(self, subject, content):
216
216
        """See ISignedCodeOfConduct."""
217
217
        assert self.owner.preferredemail
218
 
        template = open('lib/lp/registry/emailtemplates/'
 
218
        template = open('lib/canonical/launchpad/emailtemplates/'
219
219
                        'signedcoc-acknowledge.txt').read()
220
220
        fromaddress = format_address(
221
221
            "Launchpad Code Of Conduct System",
318
318
        content = ('Digitally Signed by %s\n' % sig.fingerprint)
319
319
        signed.sendAdvertisementEmail(subject, content)
320
320
 
 
321
 
321
322
    def searchByDisplayname(self, displayname, searchfor=None):
322
323
        """See ISignedCodeOfConductSet."""
323
324
        clauseTables = ['Person']
338
339
        # the name shoudl work like a filter, if you don't enter anything
339
340
        # you get everything.
340
341
        if displayname:
341
 
            query += ' AND Person.fti @@ ftq(%s)' % quote(displayname)
 
342
            query +=' AND Person.fti @@ ftq(%s)' % quote(displayname)
342
343
 
343
344
        # Attempt to search for directive
344
345
        if searchfor == 'activeonly':
389
390
    def getLastAcceptedDate(self):
390
391
        """See ISignedCodeOfConductSet."""
391
392
        return getUtility(ICodeOfConductConf).datereleased
 
393