Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
record
workbench4record
Commits
f6a5cae8
Unverified
Commit
f6a5cae8
authored
Oct 01, 2018
by
John Chilton
Committed by
GitHub
Oct 01, 2018
Browse files
Merge pull request #6809 from natefoo/purge-user-fix
[18.05] Don't delete referenced Datasets when purging users
parents
2aad3b2c
b7187f0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/galaxy/webapps/galaxy/controllers/admin.py
View file @
f6a5cae8
...
...
@@ -1490,7 +1490,6 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
# 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
...
...
@@ -1506,11 +1505,6 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment