Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.1] Fix resume_paused_jobs if no session provided #18640

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions lib/galaxy/webapps/galaxy/controllers/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,17 @@ def purge_deleted_datasets(self, trans):
)
return trans.show_error_message("Cannot purge deleted datasets from this session.")

@web.expose
@web.expose_api_anonymous
def resume_paused_jobs(self, trans, current=False, ids=None, **kwargs):
"""Resume paused jobs the active history -- this does not require a logged in user."""
"""Resume paused jobs for the active history -- this does not require a logged in user."""
if not ids and string_as_bool(current):
histories = [trans.get_history()]
refresh_frames = ["history"]
else:
raise NotImplementedError("You can currently only resume all the datasets of the current history.")
for history in histories:
history.resume_paused_jobs()
trans.sa_session.add(history)
with transaction(trans.sa_session):
trans.sa_session.commit()
return trans.show_ok_message("Your jobs have been resumed.", refresh_frames=refresh_frames)
# TODO: used in index.mako
history = trans.get_history()
if history:
history.resume_paused_jobs()
return trans.show_ok_message("Your jobs have been resumed.")
raise exceptions.RequestParameterInvalidException(
"You can currently only resume all the datasets of the current history."
)

@web.expose_api
@web.require_login("rename histories")
Expand Down
Loading