From 301c2b33f07d981f8ccfa26d0f8fc36f37d8ec72 Mon Sep 17 00:00:00 2001 From: chelsea Date: Sun, 12 Oct 2025 15:14:44 -0500 Subject: [PATCH] Re-enable community filtering for logged-in users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restores the user's community preference filtering that was temporarily disabled to fix an urgent feed issue for logged-in users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/app.py b/app.py index 76db79f..a0bc1c2 100644 --- a/app.py +++ b/app.py @@ -449,24 +449,23 @@ def api_posts(): continue # Apply user's community preferences (before filterset) - # Temporarily disabled to fix urgent feed issue for logged in users - # if user_communities: - # post_source = post_data.get('source', '').lower() - # post_platform = post_data.get('platform', '').lower() - # - # # Check if this post matches any of the user's selected communities - # matches_community = False - # for selected_community in user_communities: - # selected_community = selected_community.lower() - # # Match by exact source name or platform name - # if (post_source == selected_community or - # post_platform == selected_community or - # selected_community in post_source): - # matches_community = True - # break - # - # if not matches_community: - # continue + if user_communities: + post_source = post_data.get('source', '').lower() + post_platform = post_data.get('platform', '').lower() + + # Check if this post matches any of the user's selected communities + matches_community = False + for selected_community in user_communities: + selected_community = selected_community.lower() + # Match by exact source name or platform name + if (post_source == selected_community or + post_platform == selected_community or + selected_community in post_source): + matches_community = True + break + + if not matches_community: + continue # Apply search filter (before filterset) if search_query: