mysociety / citizenconnect

Citizen Connect project for the NHS: reporting problems, leaving reviews
https://www.nhs.uk/careconnect/choices
Other
1 stars 0 forks source link

load_organisation_parent_users_from_csv dies unhelpfully on duplicate user #1303

Open osfameron opened 10 years ago

osfameron commented 10 years ago

e.g. gives a stacktrace about database constraints.

...
django.db.utils.IntegrityError: duplicate key value violates unique constraint "auth_user_username_key"

Should probably give a more readable one-line error, specifying WHICH user is a dupe (or even warn about the duplication and continue).

stevenday commented 10 years ago

Good point about the error message.

I quite like that it completely fails rather than skipping the bad row however. It encourages you to return the whole thing to the NHS for them to fix it. Then you load the whole file in one go, rather than returning later just to load a certain row and having to remember which row it was supposed to load.