From 286f5b3e2e099f32c8eb2171f64e299d9852af92 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Fri, 29 Nov 2024 09:49:03 +0100 Subject: [PATCH] bugfixing --- app/cron_price_alert.py | 2 +- app/main.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/cron_price_alert.py b/app/cron_price_alert.py index f2f35ff..d37d89c 100755 --- a/app/cron_price_alert.py +++ b/app/cron_price_alert.py @@ -34,7 +34,7 @@ aws_secret_access_key = os.getenv('AWS_SECRET_ACCESS_KEY') berlin_tz = pytz.timezone('Europe/Berlin') pb = PocketBase('http://127.0.0.1:8090') -admin_data = pb.admins.auth_with_password(pb_admin_email, pb_password) +admin_data = pb.collection('_superusers').auth_with_password(pb_admin_email, pb_password) #Send price alert via email diff --git a/app/main.py b/app/main.py index 3796d70..881f5e0 100755 --- a/app/main.py +++ b/app/main.py @@ -1280,7 +1280,7 @@ async def get_watchlist(data: GetWatchList, api_key: str = Security(get_api_key) # Categorize tickers and fetch data for ticker in map(str.upper, ticker_list): - ticker_type = 'stock' + ticker_type = 'stocks' if ticker in etf_symbols: ticker_type = 'etf' elif ticker in crypto_symbols: @@ -1296,7 +1296,8 @@ async def get_watchlist(data: GetWatchList, api_key: str = Security(get_api_key) # Load news data news_dict = load_json(f"json/market-news/companies/{ticker}.json") if news_dict: - combined_news.append(news_dict[0]) + combined_news.extend(news_dict[:2]) + try: # Filter out the keys that need to be fetched from the screener