diff --git a/cosinnus/forms/search.py b/cosinnus/forms/search.py index ea39cc327..4e089b564 100644 --- a/cosinnus/forms/search.py +++ b/cosinnus/forms/search.py @@ -49,9 +49,9 @@ def filter_searchqueryset_for_read_access(sqs, user): result set to only include elements with read access. """ public_node = ( - SQ(public__exact=True) | # public on the object itself (applicable for groups) + SQ(public__exact="true") | # public on the object itself (applicable for groups) SQ(mt_visibility__exact=BaseTagObject.VISIBILITY_ALL) | # public via "everyone can see me" visibility meta attribute - SQ(always_visible__exact=True) # special marker for indexed objects that should always show up in search + SQ(always_visible__exact="true") # special marker for indexed objects that should always show up in search ) if user.is_authenticated: @@ -59,14 +59,14 @@ def filter_searchqueryset_for_read_access(sqs, user): pass else: logged_in_user_visibility = ( - SQ(user_visibility_mode__exact=True) & # for UserProfile search index objects + SQ(user_visibility_mode__exact="true") & # for UserProfile search index objects SQ(mt_visibility__exact=BaseTagObject.VISIBILITY_GROUP) # logged in users can see users who are visible ) my_item = ( SQ(creator__exact=user.id) ) visible_for_all_authenticated_users = ( - SQ(visible_for_all_authenticated_users=True) + SQ(visible_for_all_authenticated_users="true") ) # FIXME: known problem: ``group_members`` is a stale indexed representation of the members # of an items group. New members of a group won't be able to find old indexed items if the index @@ -82,7 +82,7 @@ def filter_searchqueryset_for_read_access(sqs, user): users_group_ids = get_cosinnus_group_model().objects.get_for_user_pks(user) if True: group_member_user_visibility = ( - SQ(user_visibility_mode__exact=True) & # for UserProfile search index objects + SQ(user_visibility_mode__exact="true") & # for UserProfile search index objects SQ(mt_visibility__exact=BaseTagObject.VISIBILITY_USER) & # team mambers can see this user SQ(membership_groups__in=users_group_ids) ) diff --git a/cosinnus/views/map_api.py b/cosinnus/views/map_api.py index 96aac1c21..63c2d1a85 100644 --- a/cosinnus/views/map_api.py +++ b/cosinnus/views/map_api.py @@ -249,7 +249,7 @@ def get_queryset(self, filter_group_id=None): # filter all default user groups if the new dashboard is being used (they count as "on plattform" and aren't shown) if getattr(settings, 'COSINNUS_USE_V2_DASHBOARD', False): - sqs = sqs.exclude(is_group_model=True, slug__in=get_default_user_group_slugs()) + sqs = sqs.exclude(is_group_model="true", slug__in=get_default_user_group_slugs()) prefer_own_portal = getattr(settings, 'MAP_API_HACKS_PREFER_OWN_PORTAL', False) # if we have no query-boosted results, use *only* our custom sorting (haystack's is very random) @@ -405,7 +405,7 @@ def get_queryset_base(self, matching_result, filter_group_id=None): 'cosinnus_organization.cosinnusorganization', )) # filter only candidates which are open for cooperation - sqs = sqs.filter(is_open_for_cooperation=True) + sqs = sqs.filter(is_open_for_cooperation="true") # exclude matching candidate itself sqs = sqs.exclude(_id=matching_result.id) return sqs