since in the tool xml the values can only be specified as str
also the attribute needs to be a str. currently, for instance,
filtering for non-str (e.g. int) metadata values does not work.
for instance this does not worked so far
```
<param ... type="data" format="fasta">
<options options_filter_attribute="metadata.sequences">
<filter type="add_value" value="1"/>
</options>
</param>
```
Also: do not run integration test on managed_config_dir: it depends on
config_dir, which is modified for testing.
Note: replaces previous commit from 9377
This used to happen in tool_form.mako (https://github.com/galaxyproject/galaxy/blob/0637e0adeeafde44405f69581c3e9b2ae7123ef7/templates/webapps/galaxy/tool_form.mako#L299),
where the code was:
```
# Handle calculating the redirect url for the special case where we have nginx proxy
# upload and need to do url_for on the redirect portion of the tool action.
try:
tool_url = h.url_for(tool.action)
except AttributeError:
assert len(tool.action) == 2
tool_url = tool.action[0] + h.url_for(tool.action[1])
```
Fixes https://sentry.galaxyproject.org/sentry/main/issues/300358/:
```
AttributeError: 'tuple' object has no attribute 'startswith'
File "galaxy/web/framework/decorators.py", line 282, in decorator
rval = func(self, trans, *args, **kwargs)
File "galaxy/webapps/galaxy/api/tools.py", line 124, in build
return tool.to_json(trans, kwd.get('inputs', kwd))
File "galaxy/tools/__init__.py", line 2057, in to_json
'action' : self.app.url_for(self.action),
File "routes/util.py", line 211, in url_for
if url.startswith('/') and hasattr(config, 'environ') \
```
This fixes https://sentry.galaxyproject.org/sentry/main/issues/502038/:
```
TypeError: a bytes-like object is required, not 'str'
File "galaxy/web/framework/decorators.py", line 282, in decorator
rval = func(self, trans, *args, **kwargs)
File "galaxy/webapps/galaxy/api/workflows.py", line 361, in create
return self.__api_import_from_archive(trans, archive_data, "uploaded file")
File "galaxy/webapps/galaxy/api/workflows.py", line 640, in __api_import_from_archive
if "GalaxyWorkflow" in archive_data:
```
The actual uploaded data is still invalid, but a more meaningful message
will be raised with this fix.
Fixes https://sentry.galaxyproject.org/sentry/main/issues/501741/:
```
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd7 in position 77: invalid continuation byte
File "galaxy/web/framework/middleware/sentry.py", line 43, in __call__
iterable = self.application(environ, start_response)
File "/cvmfs/main.galaxyproject.org/venv/lib/python3.6/site-packages/paste/recursive.py", line 85, in __call__
return self.application(environ, start_response)
File "galaxy/web/framework/middleware/statsd.py", line 34, in __call__
req = self.application(environ, start_response)
File "/cvmfs/main.galaxyproject.org/venv/lib/python3.6/site-packages/paste/httpexceptions.py", line 640, in __call__
return self.application(environ, start_response)
File "galaxy/web/framework/base.py", line 143, in __call__
return self.handle_request(environ, start_response)
File "galaxy/web/framework/base.py", line 222, in handle_request
body = method(trans, **kwargs)
File "galaxy/web/framework/decorators.py", line 57, in call_and_format
rval = func(self, trans, *args, **kwargs)
File "galaxy/webapps/galaxy/api/genomes.py", line 41, in show
region = self.app.genomes.reference(trans, dbkey=id, chrom=chrom, low=low, high=high)
File "galaxy/visualization/genomes.py", line 395, in reference
twobit = TwoBitFile(open(twobit_file_name))
File "bx/seq/twobit.py", line 56, in __init__
strng = file.read(TWOBIT_MAGIC_SIZE)
File "python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
```
https://github.com/galaxyproject/galaxy/pull/8631 added case-insensitive
matches to user emails. If two accounts with different email
capitalizations exist one of them will be picked at random for login.
To fix this we first check for exact match and only if there is no
direct match we lowercase the comparison.