AttributeError: 'NoneType' object has no attribute 'displayname' requesting people merge

Bug #1019975 reported by Diogo Matsubara
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Ian Booth

Bug Description

OOPS-094457cbe5ffa5d229cefcc993182eb9 and OOPS-1cc18b356280049eb1800b4d19d05617 triggered an AttributeError: 'NoneType' object has no attribute 'displayname' when requesting merge of accounts

https://launchpad.net/people/+requestmerge-multiple?dupe=1217327 and https://launchpad.net/people/+requestmerge?field.dupe_person=neale are the URLs that triggered the error

Relevant part of the traceback:

 Module lp.registry.browser.peoplemerge, line 412, in processForm
    token.sendMergeRequestEmail()
  Module lp.services.verification.model.logintoken, line 190, in sendMergeRequestEmail
    replacements = {'dupename': "%s (%s)" % (dupe.displayname, dupe.name),
AttributeError: 'NoneType' object has no attribute 'displayname'

Related branches

Curtis Hovey (sinzui)
tags: added: merge-deactivate
Revision history for this message
Curtis Hovey (sinzui) wrote :

This bug is implicitly fixed when we fix bug 960493 because this token was left behind my a successful merge.

Revision history for this message
William Grant (wgrant) wrote :

This is actually a regression that breaks self-service merges of some unactivated accounts. See OOPS-d75371b4ac042f74db8ac30ce3f8e4b8 for a recent example.

sendMergeRequestEmail does this:

        dupe = getUtility(IPersonSet).getByEmail(self.email)
        replacements = {'dupename': "%s (%s)" % (dupe.displayname, dupe.name),

But PersonSet.getByEmail was recently fixed to by default exclude NEW email addresses, and unactivated accounts' email addresses are NEW. So this fails to find a person. The issue and proper fix are covered by bug #1014917. We should perhaps for now change that getByEmail call to say filter_status=False.

Admins can work around this by manually setting the account to Active on +reviewaccount, and doing the merge through https://launchpad.net/people/+adminpeoplemerge after verifying ownership.

Curtis Hovey (sinzui)
tags: added: regression
Revision history for this message
Curtis Hovey (sinzui) wrote :

Lets allow merge to work with new addresses for the case of merge only.

Ian Booth (wallyworld)
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Ian Booth (wallyworld)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Ian Booth (wallyworld)
tags: added: qa-ok
removed: qa-needstesting
Steve Kowalik (stevenk)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.