|
@ -178,15 +178,21 @@ def get_group_topics( # noqa |
|
|
group for group in request.query(Group).all() if group.path != "test" |
|
|
group for group in request.query(Group).all() if group.path != "test" |
|
|
] |
|
|
] |
|
|
subgroups = None |
|
|
subgroups = None |
|
|
|
|
|
include_subgroups = False |
|
|
else: |
|
|
else: |
|
|
# otherwise, just topics from the single group that we're looking at |
|
|
# otherwise, just topics from the single group that we're looking at |
|
|
groups = [request.context] |
|
|
groups = [request.context] |
|
|
|
|
|
|
|
|
|
|
|
if request.user: |
|
|
groups.extend([ |
|
|
groups.extend([ |
|
|
sub.group for sub in request.user.subscriptions |
|
|
sub.group for sub in request.user.subscriptions |
|
|
if sub.group.is_subgroup_of(request.context) |
|
|
if sub.group.is_subgroup_of(request.context) |
|
|
]) |
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
include_subgroups = all_subgroups |
|
|
|
|
|
else: |
|
|
|
|
|
include_subgroups = True |
|
|
|
|
|
|
|
|
subgroups = ( |
|
|
subgroups = ( |
|
|
request.query(Group) |
|
|
request.query(Group) |
|
|
.filter( |
|
|
.filter( |
|
@ -214,9 +220,7 @@ def get_group_topics( # noqa |
|
|
query = ( |
|
|
query = ( |
|
|
request.query(Topic) |
|
|
request.query(Topic) |
|
|
.join_all_relationships() |
|
|
.join_all_relationships() |
|
|
.inside_groups( |
|
|
|
|
|
groups, include_subgroups=not is_home_page and all_subgroups |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
.inside_groups(groups, include_subgroups=include_subgroups) |
|
|
.exclude_ignored() |
|
|
.exclude_ignored() |
|
|
.apply_sort_option(order) |
|
|
.apply_sort_option(order) |
|
|
) |
|
|
) |
|
|