Skip to content
GitLab
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
b7187f0e
Commit
b7187f0e
authored
Oct 01, 2018
by
Nate Coraor
Browse files
Don't delete referenced Datasets when purging users.
parent
2aad3b2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/galaxy/webapps/galaxy/controllers/admin.py
View file @
b7187f0e
...
...
@@ -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
Supports
Markdown
0%
Try again
or
attach a new 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