From 3bcc1717d05bcd01fba934cda179146e474ffc78 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 27 May 2024 17:57:42 +0200 Subject: [PATCH] Restore back condition to set current history in backend The effect of this is that we can switch to any owned history in the UI, but if the history has been deleted it will not change the current history in the backend and a browser refresh will bring back the real current history. --- lib/galaxy/webapps/base/webapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/base/webapp.py b/lib/galaxy/webapps/base/webapp.py index 7874de2ef77b..0cd502606613 100644 --- a/lib/galaxy/webapps/base/webapp.py +++ b/lib/galaxy/webapps/base/webapp.py @@ -914,7 +914,7 @@ def get_history(self, create=False, most_recent=False): return history def set_history(self, history): - if history: + if history and not history.deleted: self.galaxy_session.current_history = history self.sa_session.add(self.galaxy_session) with transaction(self.sa_session): @@ -932,7 +932,7 @@ def get_or_create_default_history(self): # Just return the current history if one exists and is not deleted. history = self.galaxy_session.current_history - if history: + if history and not history.deleted: return history # Look for an existing history that has the default name, is not