mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 05:45:37 +08:00
Merge pull request #5526 from bgruening/user_filter
[18.01] fix toolbox filters
This commit is contained in:
@@ -44,7 +44,7 @@ class FilterFactory(object):
|
||||
elif name == 'toolbox_label_filters':
|
||||
category = "label"
|
||||
if category:
|
||||
validate = getattr(trans.app.config, 'user_%s_filters' % category, [])
|
||||
validate = getattr(trans.app.config, 'user_tool_%s_filters' % category, [])
|
||||
self.__init_filters(category, user_filters, filters, validate=validate)
|
||||
else:
|
||||
if kwds.get("trackster", False):
|
||||
|
||||
@@ -708,11 +708,22 @@ class UserAPIController(BaseAPIController, UsesTagsMixin, CreatesUsersMixin, Cre
|
||||
function = factory.build_filter_function(filter_name)
|
||||
if function is None:
|
||||
errors['%s|%s' % (filter_type, filter_name)] = 'Filter function not found.'
|
||||
|
||||
short_description, description = None, None
|
||||
doc_string = docstring_trim(function.__doc__)
|
||||
split = doc_string.split('\n\n')
|
||||
if split:
|
||||
short_description = split[0]
|
||||
if len(split) > 1:
|
||||
description = split[1]
|
||||
else:
|
||||
log.warning('No description specified in the __doc__ string for %s.' % filter_name)
|
||||
|
||||
filter_inputs.append({
|
||||
'type': 'boolean',
|
||||
'name': filter_name,
|
||||
'label': filter_name,
|
||||
'help': docstring_trim(function.__doc__) or 'No description available.',
|
||||
'label': short_description or filter_name,
|
||||
'help': description or 'No description available.',
|
||||
'value': 'true' if filter_name in filter_values else 'false'
|
||||
})
|
||||
if filter_inputs:
|
||||
|
||||
Reference in New Issue
Block a user