{"action":"created","issue":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/2824","labels_url":"https://api.github.com/repos/IQSS/dataverse/issues/2824/labels{/name}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/2824/comments","events_url":"https://api.github.com/repos/IQSS/dataverse/issues/2824/events","html_url":"https://github.com/IQSS/dataverse/issues/2824","id":122110679,"number":2824,"title":"API: unable to delete users who have published (usernotification table)","user":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20API","name":"Component: API","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20Code%20Infrastructure","name":"Component: Code Infrastructure","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Status:%20Dev","name":"Status: Dev","color":"66cc66"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Type:%20Bug","name":"Type: Bug","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"scolapasta","id":4268292,"avatar_url":"https://avatars.githubusercontent.com/u/4268292?v=3","gravatar_id":"","url":"https://api.github.com/users/scolapasta","html_url":"https://github.com/scolapasta","followers_url":"https://api.github.com/users/scolapasta/followers","following_url":"https://api.github.com/users/scolapasta/following{/other_user}","gists_url":"https://api.github.com/users/scolapasta/gists{/gist_id}","starred_url":"https://api.github.com/users/scolapasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scolapasta/subscriptions","organizations_url":"https://api.github.com/users/scolapasta/orgs","repos_url":"https://api.github.com/users/scolapasta/repos","events_url":"https://api.github.com/users/scolapasta/events{/privacy}","received_events_url":"https://api.github.com/users/scolapasta/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/IQSS/dataverse/milestones/47","html_url":"https://github.com/IQSS/dataverse/milestones/4.2.3","labels_url":"https://api.github.com/repos/IQSS/dataverse/milestones/47/labels","id":1425445,"number":47,"title":"4.2.3","description":"We plan to upgrade to Primefaces 5.x (#2730) and Java 8 (#2151). This \"technology upgrade\" (#2731) is currently being worked on at https://github.com/IQSS/dataverse/tree/2731-techupdate","creator":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":30,"state":"open","created_at":"2015-11-23T16:27:26Z","updated_at":"2016-01-08T18:12:19Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-12-14T19:17:54Z","updated_at":"2016-01-08T18:19:38Z","closed_at":null,"body":"I'm in the 4.3.2 branch (e10e6fb) writing API integration tests as part of #2746 and now that I'm starting to publish dataverses and datasets via API I'm no longer able to delete the users that created them. I'm getting this:\r\n\r\norg.postgresql.util.PSQLException: ERROR: update or delete on table \"authenticateduser\" violates foreign key constraint \"fk_usernotification_user_id\" on table \"usernotification\"\r\n  Detail: Key (id)=(54) is still referenced from table \"usernotification\".\r\n\r\nAs I mentioned on the Google Group recently at https://groups.google.com/forum/#!topic/dataverse-community/NXnVDrh1-h8 I'm not sure how much we want to support this operation of deleting users but for testing it can be useful.\r\n"},"comment":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/comments/170079694","html_url":"https://github.com/IQSS/dataverse/issues/2824#issuecomment-170079694","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/2824","id":170079694,"user":{"login":"scolapasta","id":4268292,"avatar_url":"https://avatars.githubusercontent.com/u/4268292?v=3","gravatar_id":"","url":"https://api.github.com/users/scolapasta","html_url":"https://github.com/scolapasta","followers_url":"https://api.github.com/users/scolapasta/followers","following_url":"https://api.github.com/users/scolapasta/following{/other_user}","gists_url":"https://api.github.com/users/scolapasta/gists{/gist_id}","starred_url":"https://api.github.com/users/scolapasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scolapasta/subscriptions","organizations_url":"https://api.github.com/users/scolapasta/orgs","repos_url":"https://api.github.com/users/scolapasta/repos","events_url":"https://api.github.com/users/scolapasta/events{/privacy}","received_events_url":"https://api.github.com/users/scolapasta/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T18:19:38Z","updated_at":"2016-01-08T18:19:38Z","body":"We shouldn't delete users who have \"done\" something - created a dataset, released a dataset, etc.\r\n\r\nDeleting user notifications and role assignments is fine. But we do need to track who created or released - in those cases, if anything, we would want to disable them as @pdurbin metioned and is tracked by #2419.\r\n\r\nHowever, we should make the API call cleaner, I think, by checking for these things first and proviing a friendlier message."}}