Skip to content

Commit

Permalink
Merge pull request #6809 from natefoo/purge-user-fix
Browse files Browse the repository at this point in the history
[18.05] Don't delete referenced Datasets when purging users
  • Loading branch information
jmchilton committed Oct 1, 2018
2 parents 2aad3b2 + b7187f0 commit f6a5cae
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/galaxy/webapps/galaxy/controllers/admin.py
Expand Up @@ -1490,7 +1490,6 @@ def _purge_user(self, trans, ids):
# Purging a deleted User deletes all of the following:
# - History where user_id = User.id
# - HistoryDatasetAssociation where history_id = History.id
# - Dataset where HistoryDatasetAssociation.dataset_id = Dataset.id
# - UserGroupAssociation where user_id == User.id
# - UserRoleAssociation where user_id == User.id EXCEPT FOR THE PRIVATE ROLE
# - UserAddress where user_id == User.id
Expand All @@ -1506,11 +1505,6 @@ def _purge_user(self, trans, ids):
trans.sa_session.refresh(h)
for hda in h.active_datasets:
# Delete HistoryDatasetAssociation
d = trans.sa_session.query(trans.app.model.Dataset).get(hda.dataset_id)
# Delete Dataset
if not d.deleted:
d.deleted = True
trans.sa_session.add(d)
hda.deleted = True
trans.sa_session.add(hda)
h.deleted = True
Expand Down

0 comments on commit f6a5cae

Please sign in to comment.