~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/authserver/database.py

  • Committer: Guilherme Salgado
  • Date: 2008-07-02 12:51:24 UTC
  • mto: This revision was merged to the branch mainline in revision 6630.
  • Revision ID: salgado@canonical.com-20080702125124-rnj2qz2rrfv9k7eo
Fix https://launchpad.net/bugs/241332

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from canonical.launchpad.interfaces import (
23
23
    BranchCreationException, BranchType, IBranchSet, IPersonSet, IProductSet,
24
24
    UnknownBranchTypeError)
25
 
from canonical.launchpad.ftests import login, logout, ANONYMOUS
 
25
from canonical.launchpad.ftests import login, login_person, logout, ANONYMOUS
26
26
from canonical.launchpad.validators import LaunchpadValidationError
27
27
from canonical.launchpad.webapp.authentication import SSHADigestEncryptor
28
28
from canonical.database.sqlbase import clear_current_connection_cache
96
96
            # and expect `function` to use `removeSecurityProxy` or similar.
97
97
            return function(self, LAUNCHPAD_SERVICES, *args, **kwargs)
98
98
        requester = self._getPerson(loginID)
99
 
        login(requester.preferredemail.email)
 
99
        login_person(requester)
100
100
        try:
101
101
            return function(self, requester, *args, **kwargs)
102
102
        finally:
113
113
    def _getEmailAddresses(self, person):
114
114
        """Get the email addresses for a person"""
115
115
        emails = [person.preferredemail] + list(person.validatedemails)
116
 
        return (
117
 
            [person.preferredemail.email] +
118
 
            [email.email for email in person.validatedemails])
 
116
        return [removeSecurityProxy(email).email for email in emails]
119
117
 
120
118
    def getSSHKeys(self, loginID):
121
119
        """See `IUserDetailsStorage`."""