← Back to team overview

launchpad-dev team mailing list archive

EmailAddressAlreadyTaken: account and person split

 

Hi Salgado, all,
	
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.

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
extend creation_rationale with an element which can be easily split out;
g. do something like:

  Person.uses_launchpad = creation_rationale & 0x10000
  Person.creation_rationale = creation_rationale & 0xffff

Not sure how well this would cope with our DBEnum usage (i.e. form
writes might lose it if we don't deal properly with it, especially since
Storm doesn't support setters and getters), but I feel that might be a
worthwhile workaround otherwise.

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.

Cheers,
Danilo





Follow ups