extend views so we can "edit people"

Bug #1166477 reported by Andrew Starr-Bochicchio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
D-A-T Overview
Fix Released
High
Unassigned

Bug Description

I've already created a per-contributor view, but we will need to be able to do things like edit the email and lpid fields. The is related to bug #1142796 "Clean/correct data" It's not as simple as just editing the value in the people table as we need to reflect those changes in the uploads table as well.

It might make sense to do this in a way that puts most of the logic in some common file that could either be triggered for individual contributors when editing their page or from a management command that takes a file (json or some such) as an argument to update a batch of contributors at once. Especially when we first deploy, there will be a number of lpid "merges" that will need to be done. I think daniel has a list of some known contributors who have changed lpids.

We should think a bit more about the email field as well. Right now, for the people table, I'm only storing the value of the first email found when parsing the uploads that matches a contributor. For instance:

django_db=# SELECT DISTINCT(email_changer) FROM uploads WHERE lpid_changer = 'andrewsomething';
    email_changer
---------------------
 <email address hidden>
 <email address hidden>
(2 rows)

django_db=# SELECT email FROM people WHERE lpid = 'andrewsomething';
        email
---------------------
 <email address hidden>
(1 row)

The email in the people table as things stand, will always be connected to a valid LPID. That actually accounts for the vast majority of uploads:

django_db=# SELECT COUNT(*) FROM uploads WHERE lpid_changer = '';
 count
-------
 30047
(1 row)

django_db=# SELECT COUNT(*) FROM uploads WHERE lpid_changer <> '';
 count
--------
 377314
(1 row)

Related branches

Changed in dat-overview:
status: New → Triaged
importance: Undecided → High
Changed in dat-overview:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.