diff --git a/app/api/alpha/utils/post.py b/app/api/alpha/utils/post.py index 0ca622d5..85b87c34 100644 --- a/app/api/alpha/utils/post.py +++ b/app/api/alpha/utils/post.py @@ -13,7 +13,8 @@ from sqlalchemy import desc def cached_post_list(type, sort, user_id, community_id, community_name, person_id): if type == "All": if community_name: - posts = Post.query.filter_by(deleted=False).join(Community, Community.id == Post.community_id).filter_by(show_all=True, name=community_name) + name, ap_domain = community_name.split('@') + posts = Post.query.filter_by(deleted=False).join(Community, Community.id == Post.community_id).filter_by(show_all=True, name=name, ap_domain=ap_domain) elif community_id: posts = Post.query.filter_by(deleted=False).join(Community, Community.id == Post.community_id).filter_by(show_all=True, id=community_id) elif person_id: diff --git a/app/api/alpha/views.py b/app/api/alpha/views.py index a00dae5e..78051b28 100644 --- a/app/api/alpha/views.py +++ b/app/api/alpha/views.py @@ -172,7 +172,8 @@ def community_view(community: Community | int | str, variant, stub=False, user_i if isinstance(community, int): community = Community.query.get(community) elif isinstance(community, str): - community = Community.query.filter_by(name=community).first() + name, ap_domain = community.split('@') + community = Community.query.filter_by(name=name, ap_domain=ap_domain).first() if not community: raise Exception('community_not_found')