Fix small bug with /daily if close_profit_abs is not yet filled

This commit is contained in:
Matthias 2020-09-03 19:29:48 +02:00
parent 10c5b230b4
commit 5c5cf782f5

View File

@ -224,7 +224,8 @@ class RPC:
Trade.close_date >= profitday,
Trade.close_date < (profitday + timedelta(days=1))
]).order_by(Trade.close_date).all()
curdayprofit = sum(trade.close_profit_abs for trade in trades)
curdayprofit = sum(
trade.close_profit_abs for trade in trades if trade.close_profit_abs is not None)
profit_days[profitday] = {
'amount': curdayprofit,
'trades': len(trades)