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.
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)
= 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: registry/ browser/ person. py registry/ stories/ foaf/xx- team-claim. txt
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ registry/ browser/ person. py interface' (No module named restful)
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.