kjolley / BIGSdb

Bacterial Isolate Genome Sequence Database (BIGSdb): A platform for gene-by-gene bacterial population annotation and analysis.
https://pubmlst.org/software/bigsdb/
Other
61 stars 20 forks source link

Impossible to purge a user that is curator of a project #847

Closed bryan-brancotte closed 2 years ago

bryan-brancotte commented 2 years ago

Hi Keith,

We are experiencing minor issue with sync_user_dbase_users.pl as the script want to delete a user which is a curator and admin of a project (i.e there is an entry in project_users) while not the main curator (not curator in projects.curator table).

Here are the logs:

ERROR - Could not delete XXXXXXXXX for XXXXXXXX. DBD::Pg::db do failed: ERROR:  update or delete on table "users" violates foreign key constraint "pu_curator" on table "project_users"
DETAIL:  Key (id)=(XXXXXXXX) is still referenced from table "project_users". at /(...)/sync_user_dbase_users.pl line 717.

Maybe the membership should be dropped when the user is removed ? Or do you think we should keep the user ?

This is clearly not a blocking issue, it is just something you might encounter as well later so raising it here.

Best wishes

P.S: discussed with @fedex88

kjolley commented 2 years ago

I think, in this case, that it is safer to not drop the user. I'll take a look. Thanks.