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