DemocracyClub / candidate_questions

BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

Track yournextmp.com updates to candidate details #14

Open graphiclunarkid opened 9 years ago

graphiclunarkid commented 9 years ago

So that I can maximise the number of candidates invited to use the site As an Administrator I want to receive updates to existing candidate details

Scenario: An existing candidate gains an email address Given there is a Candidate without email addresses And an email address has been added for that candidate via yournextmp.com When I run the CSV importer Then the candidate's email address should be updated And their "invited" flag should be cleared

Scenario: An existing candidate changes email address Given there is a Candidate with an email address And their email address is changed via yournextmp.com When I run the CSV importer Then the candidate's email address should be updated

Scenario: A new candidate is added Given there are one or more Candidates in yournextmp.com And these candidates are not in our database When I run the CSV importer Then the candidates are created in our database

graphiclunarkid commented 9 years ago

We have imported our candidate data from the YourNextMP CSV. There is a Django admin command for loading the CSV. It uses the popit ID to skip existing candidates. It doesn't try to update the information about existing candidates.

https://github.com/DemocracyClub/candidate_questions/blob/master/q_and_a/apps/candidates/management/commands/import_candidates.py

It would be easy to have a daily cron job that downloads and imports the current CSV. We can change the importer to update existing candidates with any changes.

I think we would want to pick up changes to the email addresses of existing candidates. Not sure whether we would want to clear their "invited" status on change from one address to another though. Open to suggestions on that point.

We would definitely want to invite existing candidates who gained an email address through an update if they did not previously have one.