From feb38afccb51bb7b59f204818c5654e183410535 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 5 Mar 2024 10:45:25 +0100 Subject: [PATCH 1/2] Fix tool shed webapp --- lib/galaxy/webapps/base/webapp.py | 3 ++- lib/tool_shed/webapp/buildapp.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/base/webapp.py b/lib/galaxy/webapps/base/webapp.py index 7358fdb393f4..effc7a489131 100644 --- a/lib/galaxy/webapps/base/webapp.py +++ b/lib/galaxy/webapps/base/webapp.py @@ -650,7 +650,8 @@ def _ensure_valid_session(self, session_cookie: str, create: bool = True) -> Non galaxy_session = self.__create_new_session(prev_galaxy_session, user_for_new_session) galaxy_session_requires_flush = True self.galaxy_session = galaxy_session - self.get_or_create_default_history() + if self.webapp.name == "galaxy": + self.get_or_create_default_history() self.__update_session_cookie(name=session_cookie) else: self.galaxy_session = galaxy_session diff --git a/lib/tool_shed/webapp/buildapp.py b/lib/tool_shed/webapp/buildapp.py index e25859c33be6..49ecfb6fb525 100644 --- a/lib/tool_shed/webapp/buildapp.py +++ b/lib/tool_shed/webapp/buildapp.py @@ -36,6 +36,10 @@ class ToolShedGalaxyWebTransaction(GalaxyWebTransaction): def repositories_hostname(self) -> str: return url_for("/", qualified=True).rstrip("/") + def get_or_create_default_history(self): + # tool shed has no concept of histories + return None + class CommunityWebApplication(galaxy.webapps.base.webapp.WebApplication): injection_aware: bool = True From c598c49f62296c0d1bf4209d0362b0fdc0122141 Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Tue, 5 Mar 2024 15:52:17 +0100 Subject: [PATCH 2/2] Raise NotImplementedError for TS `get_or_create_default_history` --- lib/tool_shed/webapp/buildapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tool_shed/webapp/buildapp.py b/lib/tool_shed/webapp/buildapp.py index 49ecfb6fb525..05388285ea2b 100644 --- a/lib/tool_shed/webapp/buildapp.py +++ b/lib/tool_shed/webapp/buildapp.py @@ -38,7 +38,7 @@ def repositories_hostname(self) -> str: def get_or_create_default_history(self): # tool shed has no concept of histories - return None + raise NotImplementedError class CommunityWebApplication(galaxy.webapps.base.webapp.WebApplication):