fix: load cached FB posts for admin users (user_company_ids=None)
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Admin's _get_user_company_ids returns None meaning all companies,
but iterating over None gave empty list. Now falls back to fb_stats keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-20 08:52:12 +01:00
parent 38b2372f7e
commit 8f71b040ad

View File

@ -116,7 +116,8 @@ def social_publisher_list():
# Load cached FB posts from DB for instant rendering
cached_fb_posts = {}
for cid in (user_company_ids or []):
cache_company_ids = user_company_ids if user_company_ids is not None else list(fb_stats.keys())
for cid in cache_company_ids:
cached = social_publisher.get_cached_posts(cid)
if cached:
cached_fb_posts[cid] = cached