Allow anonymous users to use tools with injected API keys.

https://github.com/galaxyproject/galaxy/pull/8897/files#r342997635
This commit is contained in:
John Chilton
2019-11-06 06:44:40 -05:00
parent 8807a8f39f
commit 58f2382ad0
+5 -2
View File
@@ -547,8 +547,11 @@ class ToolEvaluator(object):
environment_variable_template = environment_variable_def["template"]
inject = environment_variable_def.get("inject")
if inject == "api_key":
from galaxy.managers import api_keys
environment_variable_template = api_keys.ApiKeyManager(self.app).get_or_create_api_key(self._user)
if self._user:
from galaxy.managers import api_keys
environment_variable_template = api_keys.ApiKeyManager(self.app).get_or_create_api_key(self._user)
else:
environment_variable_template = ""
is_template = False
else:
is_template = True