From 6af4138547f15c9438ba13c073bc8e1fad3cd63d Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 4 Jun 2024 18:01:02 +0200 Subject: [PATCH] Skip new history creation of user is anonymous and login is required Most straightforward fix for https://github.com/galaxyproject/galaxy/issues/18317. I have not been able to reproduce the issue itself though, only a single history is being created in my testing. --- lib/galaxy/webapps/base/webapp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/galaxy/webapps/base/webapp.py b/lib/galaxy/webapps/base/webapp.py index b9430a3774c0..b9bd9eb717ce 100644 --- a/lib/galaxy/webapps/base/webapp.py +++ b/lib/galaxy/webapps/base/webapp.py @@ -932,6 +932,10 @@ def get_or_create_default_history(self): self.set_history(history) return history + # Don't create new history if login required and user is anonymous + if self.app.config.require_login and not self.user: + return None + # No suitable history found, create a new one. return self.new_history()