Update usages of search_all_objects

This commit is contained in:
Matthias
2022-10-14 14:41:25 +00:00
parent 1d8d360a12
commit 9d4ba767c4
5 changed files with 20 additions and 14 deletions

View File

@@ -253,11 +253,9 @@ def plot_config(rpc: RPC = Depends(get_rpc)):
@router.get('/strategies', response_model=StrategyListResponse, tags=['strategy'])
def list_strategies(config=Depends(get_config)):
directory = Path(config.get(
'strategy_path', config['user_data_dir'] / USERPATH_STRATEGIES))
from freqtrade.resolvers.strategy_resolver import StrategyResolver
strategies = StrategyResolver.search_all_objects(
directory, False, config.get('recursive_strategy_search', False))
config, False, config.get('recursive_strategy_search', False))
strategies = sorted(strategies, key=lambda x: x['name'])
return {'strategies': [x['name'] for x in strategies]}