From e087762c15095cc0ba561dc8fb1831a978cdc83f Mon Sep 17 00:00:00 2001 From: Alex Ostrovsky <40246333+astrovsky01@users.noreply.github.com> Date: Tue, 17 Nov 2020 14:35:41 -0800 Subject: [PATCH 1/3] Update 20.09_announce_user.rst --- doc/source/releases/20.09_announce_user.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/releases/20.09_announce_user.rst b/doc/source/releases/20.09_announce_user.rst index 572b3603864..94b00e00fd7 100644 --- a/doc/source/releases/20.09_announce_user.rst +++ b/doc/source/releases/20.09_announce_user.rst @@ -46,7 +46,7 @@ For updated tutorials, tools will be highlighted as blue buttons. When clicked, Thanks `@pvanheus `__ for the video of it in action! -Upload Directly from the Tool From +Upload Directly from the Tool Form ---------------------------------- Did you ever start configuring a tool but forgot to upload your datasets first? And had to start over? Now you can upload datasets directly in the tool form thanks to `@jmchilton `__. `Pull Request 9809`_ From 6c76cf8178aa151ce18acfc53300fe0da694cd3b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 18 Nov 2020 10:40:46 +0100 Subject: [PATCH 2/3] Fix anonymous user uploads if file sources configured To get both file source uploads to work and anonymous uploads you would need to use something like ``` ${user.preferences.get('dropbox|access_token') if $user.preferences else ''} ``` This simplifies that back to the documented ``` ${user.preferences['dropbox|access_token'] ``` Overall I don't think we benefit from KeyErrors in the extra file preferences, so I've made this `defaultdict(lambda: None)`, but we could limit that to just the ProvidesUserFileSourcesUserContext. Fixes https://github.com/galaxyproject/galaxy/issues/10595. --- lib/galaxy/files/__init__.py | 7 +++++-- lib/galaxy/model/__init__.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/files/__init__.py b/lib/galaxy/files/__init__.py index 49f1eae337a..d96a7fc0d5c 100644 --- a/lib/galaxy/files/__init__.py +++ b/lib/galaxy/files/__init__.py @@ -1,6 +1,9 @@ import logging import os -from collections import namedtuple +from collections import ( + defaultdict, + namedtuple, +) from galaxy import exceptions from galaxy.util import ( @@ -229,7 +232,7 @@ class ProvidesUserFileSourcesUserContext(object): @property def preferences(self): user = self.trans.user - return user and user.extra_preferences + return user and user.extra_preferences or defaultdict(lambda: None) class DictFileSourcesUserContext(object): diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index e6f51519af1..80efea59704 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -15,6 +15,7 @@ import pwd import random import string import time +from collections import defaultdict from datetime import datetime, timedelta from string import Template from uuid import UUID, uuid4 @@ -380,7 +381,7 @@ class User(Dictifiable, RepresentById): @property def extra_preferences(self): - data = {} + data = defaultdict(lambda: None) extra_user_preferences = self.preferences.get('extra_user_preferences') if extra_user_preferences: try: From 8968e0a2563eda9b5ed5b7b4d729a1b1fde913f5 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 18 Nov 2020 17:31:44 +0100 Subject: [PATCH 3/3] Don't preload editor mako with hidden workflows Fixes https://github.com/galaxyproject/galaxy/issues/10746 --- lib/galaxy/webapps/galaxy/controllers/workflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/workflow.py b/lib/galaxy/webapps/galaxy/controllers/workflow.py index 8173d82d443..397a0e54c6f 100644 --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -653,7 +653,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi # The following query loads all user-owned workflows, # So that they can be copied or inserted in the workflow editor. workflows = trans.sa_session.query(model.StoredWorkflow) \ - .filter_by(user=trans.user, deleted=False) \ + .filter_by(user=trans.user, deleted=False, hidden=False) \ .order_by(desc(model.StoredWorkflow.table.c.update_time)) \ .options(joinedload('latest_workflow').joinedload('steps')) \ .all()