Slightly reformat to simplify new change

This commit is contained in:
Matthias 2021-11-07 10:55:11 +01:00
parent 2115a3ed12
commit 4595c1e73c

View File

@ -198,17 +198,17 @@ class FreqtradeBot(LoggingMixin):
""" """
open_trades = Trade.get_trades([Trade.is_open.is_(True)]).all() open_trades = Trade.get_trades([Trade.is_open.is_(True)]).all()
if len(open_trades) != 0: if len(open_trades) != 0 and self.state != State.RELOAD_CONFIG:
if self.state != State.RELOAD_CONFIG: msg = {
msg = { 'type': RPCMessageType.WARNING,
'type': RPCMessageType.WARNING, 'status':
'status': f"{len(open_trades)} open trades active.\n\n" f"{len(open_trades)} open trades active.\n\n"
f"Handle these trades manually on {self.exchange.name}, " f"Handle these trades manually on {self.exchange.name}, "
f"or '/start' the bot again and use '/stopbuy' " f"or '/start' the bot again and use '/stopbuy' "
f"to handle open trades gracefully. \n" f"to handle open trades gracefully. \n"
f"{'Note: Trades are simulated (dry run).' if self.config['dry_run'] else ''}", f"{'Note: Trades are simulated (dry run).' if self.config['dry_run'] else ''}",
} }
self.rpc.send_msg(msg) self.rpc.send_msg(msg)
def _refresh_active_whitelist(self, trades: List[Trade] = []) -> List[str]: def _refresh_active_whitelist(self, trades: List[Trade] = []) -> List[str]:
""" """