From 04a68a4298e04e99e0081865a130cf6b4dcc33b0 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:00:30 +1300 Subject: [PATCH] blocking an instance hides communities too --- app/main/routes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/main/routes.py b/app/main/routes.py index 6c9759ff..43fed236 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -199,6 +199,9 @@ def list_communities(): communities = communities.filter(Community.nsfw == False) if current_user.hide_nsfl == 1: communities = communities.filter(Community.nsfl == False) + instance_ids = blocked_instances(current_user.id) + if instance_ids: + communities = communities.filter(or_(Community.instance_id.not_in(instance_ids), Community.instance_id == None)) else: communities = communities.filter(and_(Community.nsfw == False, Community.nsfl == False))