Code review comment for lp:~wgrant/launchpad/bug-433385

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

= Summary =

ensurePerson now creates unclaimed Persons with hide_email_addresses set. PersonView.context_is_probably_team assumes that the user can always see the Person's EmailAddresses, which is no longer the case.

This is a perfectly valid (and arguably more correct) state for the data, so the view needs to handle it.

== Proposed fix ==

Use removeSecurityProxy on the EmailAddresses before attempting to access their 'email' attribute.

== Pre-implementation notes ==

None. It was affecting me locally, so I JFDI.

== Implementation details ==

Nothing special.

== Tests ==

I amended an existing team claim test to hide the Person's email addresses first.

bin/test -vvt xx-team-claim.txt

== Demo and Q/A ==

This is difficult without DB access. On the production DB, you would need to identify an unclaimed person created in the past 11 or so days by gina (the only LP instance that I know to have the relevant CP), then attempt to view that Person's index. If this fix works, you will receive a 403 on production, but a success on edge.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/browser/person.py
  lib/lp/registry/stories/foaf/xx-team-claim.txt

== Pylint notices ==

lib/lp/registry/browser/person.py
    117: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
    118: [F0401] Unable to import 'lazr.config' (No module named config)
    119: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)

« Back to merge proposal