launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #02261
Re: verifying fix of attempt to write to read-only slave
On Fri, Jan 15, 2010 at 12:00 PM, Edwin Grubbs <edwin.grubbs@xxxxxxxxxxxxx> wrote:
I can't figure out how to test bug 506963 on launchpad.dev. This is in
part because I can't understand how this error could have possibly
happen. The form is submitted as a POST, so the dbpolicy should choose
the master main store. Although the EmailAddress is normally retrieved
from the auth store, which appears to replicate that table from the
main store, the place where this error occurs should be getting the
email address from the store provided by Store.of(person).
Does anyone know what is going on here?
You have things backwards. EmailAddress is part of the auth store, and available read-only via the main store. Store.of(person) will generally give you the main store.
Best way of fixing this sort of thing is if you need to write to an object, cast it to the master version - IMasterObject(emailaddress) will be a no-op if you already have the writable object and is future proof when tables get shuffled around.
lib/canonical/launchpad/doc/storm.txt for more details
.
--
Stuart Bishop <stuart@xxxxxxxxxxxxxxxx>
http://www.stuartbishop.net/
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups
References