Merge lp:~michael.nelson/launchpad/598464-qa-fix into lp:launchpad

Proposed by Michael Nelson
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 11209
Proposed branch: lp:~michael.nelson/launchpad/598464-qa-fix
Merge into: lp:launchpad
Diff against target: 12 lines (+1/-1)
1 file modified
lib/lp/registry/model/person.py (+1/-1)
To merge this branch: bzr merge lp:~michael.nelson/launchpad/598464-qa-fix
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) code Approve
Review via email: mp+30545@code.launchpad.net

Commit message

When a new person is created from an SSO account, ensure we lookup the newly created person using the master database policy.

Description of the change

Overview
========
This branch ensures that after a new person is created using the master db policy, the lookup for that person is done also within the master db policy.

It is responsible for bug 598464 (OOPS-1663S295). There is a separate bug about the vagueness of the raised error (bug 607476).

Details
=======
It's a one-line change ;)

Test
====
You can ensure all the related tests still pass with:

$ bin/test -vv -m test_personset

Testing this specific change could be tricky. I chatted with Gary about it and we couldn't think of a proper way to test slave/master related issues easily without a hack. In the past for a different issue I've chatted with stub about the possibility, and he seemed to think it's not possible to test directly (as the slave/master policies are for the same connection on a dev server).

To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

It wasn't at all clear from the diff how an extra indent level on that one line fixed the behaviour, but it turns out that it does.

For the record, I suspect it may be possible to check for the right store by asserting that:

    Store.of(person) == IMasterStore(person).

But I'll admit that it may be fragile.

Jeroen

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/model/person.py'
2--- lib/lp/registry/model/person.py 2010-07-19 15:32:21 +0000
3+++ lib/lp/registry/model/person.py 2010-07-21 15:17:53 +0000
4@@ -2502,7 +2502,7 @@
5 creation_rationale, comment=comment)
6 db_updated = True
7
8- return IPerson(account), db_updated
9+ return IPerson(account), db_updated
10
11 def newTeam(self, teamowner, name, displayname, teamdescription=None,
12 subscriptionpolicy=TeamSubscriptionPolicy.MODERATED,