From fa0ce85b6aaa625ad7bd9aff34315dd0ee271a5a Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Tue, 7 Jan 2025 17:24:18 +0100 Subject: [PATCH] bugfixing --- app/cron_list.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/cron_list.py b/app/cron_list.py index 8eb646f..b098733 100644 --- a/app/cron_list.py +++ b/app/cron_list.py @@ -58,15 +58,15 @@ async def process_category(cursor, category, condition, category_type='market-ca 'name': row[1], 'price': round(quote_data.get('price'), 2) if quote_data.get('price') is not None else None, 'changesPercentage': round(quote_data.get('changesPercentage'), 2) if quote_data.get('changesPercentage') is not None else None, - 'marketCap': quote_data.get('marketCap', None), - 'revenue': None, + 'marketCap': quote_data.get('marketCap', 0), + 'revenue': 0, } # Add screener data if available if symbol in stock_screener_data_dict: - item['revenue'] = stock_screener_data_dict[symbol].get('revenue') + item['revenue'] = stock_screener_data_dict[symbol].get('revenue',0) - if item['marketCap'] > 0: + if item['marketCap'] > 0 and item['revenue'] > 0: res_list.append(item) # Sort by market cap and save