AbundantCommunities / CommonGood

CommonGood is open source software, a webapp that records and manages information from Abundant Communities Initiative (ACI) interviews. Multiple neighbourhoods' data kept separate.
http://abundantcommunityinitiative.org/software
GNU General Public License v3.0
1 stars 0 forks source link

NC can create herself again, locking herself out #128

Closed cognish closed 5 years ago

cognish commented 6 years ago

When we create a new neighbourhood in CG, we make new rows for neighbourhood, block, address, family and person. In the person row we enter the information we know about the NC, especially her email address. With a bit more work, the NC has a password and logs into CG.

Let's say that Alice then creates a new block, address, family and person for herself and records the same email address we entered to the person row we created. Whoa! Why did CG allow her to enter an email address that is already recorded in a previous person row? Because it is common for spouses to share an email address. But the NC has created a problem.

The next time the NC authenticates to CG or asks for a password reset (both actions cause CG to select on email address), there is a 50% chance CG will find the "wrong person row".

cognish commented 6 years ago

At this moment, in production, this query returns 647 rows: SELECT email_address, COUNT(*) FROM person GROUP BY email_address HAVING COUNT(*) > 2

cognish commented 6 years ago

At this moment, in production, no duplicate email addresses belong to a person with app_user true.

cognish commented 5 years ago

User can no longer save a Person.emailAddress that is already on file. However, we should enhance the UI to detect this as soon as the offending address is entered, not when they hit the Save button.