← Back to team overview

launchpad-dev team mailing list archive

Re: EmailAddressAlreadyTaken: account and person split

 

On Mon, Aug 10, 2009 at 06:29:43PM +0200, Danilo Šegan wrote:
> I've just noticed a problem in our person creation code:
> 
>   https://bugs.edge.launchpad.net/rosetta/+bug/411514
> 
> We are trying to create a Person record to attribute translations to,
> however, since account for the email already exists,
> createPersonAndEmail fails with EmailAddressAlreadyTaken exception.

Won't this happen in a wide range of situations -- essentially anywhere
where we are attempting to create Persons lazily where there are
existing Accounts?

> This is almost identical to 
> 
>   https://bugs.edge.launchpad.net/launchpad-foundations/+bug/408528
> 
> The problem with blindly creating a Person in these cases is that we are
> using existence of Person record as an indicator that someone has
> knowingly registered on Launchpad (as opposed to just using shipit or a
> similar service), so we can't do that without providing an indicator
> that certain Person record was explicitely registered (or activated) or
> if it was just automatically generated through some import.
> 
> To properly fix this, we'd probably provide a new attribute (and DB
> column) on Person objects.  But, without a DB column, we can perhaps

Uhm.. I think I understand -- essentially because Rosetta wants to
credit a translation to a Person, and in this case we need to create one
and match it with an Account that already exists. But this is a curious
situation to me:

    - The Account itself has already been created, so it should already
      have its own creation rationale, right?

    - Why does recording the Person's creation rationale matter? Or is
      the issue more that if there is a Person record then we assume
      that the person uses Launchpad?

> Salgado wanted more discussion on the topic on list, and it'd be nice to
> come up with a suitable workaround, and if we can come up with one
> that's cherrypickable, even better.

It seems odd that we have this situation, where parts of the Launchpad
application are happy to work directly with Accounts and other parts
require Persons. Is it just that OpenID and ShipIt are special in this
sense, and that the rest of Launchpad is all engineered around Person?

If so, then a DB patch uses_launchpad would make sense and I'm sure we
could get it in this cycle. But I ask myself, would there be Person
records that had no accompanying Account records? Because that's what I
think would be correct modeling for this situation -- nobody actually
created an account, right?
-- 
Christian Robottom Reis | [+55 16] 3376 0125 | http://launchpad.net/~kiko
                        | [+55 16] 9112 6430 | http://async.com.br/~kiko



Follow ups

References