Skip to content
Snippets Groups Projects
Verified Commit d8c9af03 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Reformat

parent 8f8309d1
No related branches found
No related tags found
1 merge request!1098Resolve "Make progress page and search bar use GraphQL"
......@@ -11,7 +11,7 @@ from haystack.utils.loading import UnifiedIndex
from .forms import PersonForm
from .models import Group, Notification, Person, TaskUserAssignment
from .util.core_helpers import get_app_module, get_app_packages, has_person, get_allowed_object_ids
from .util.core_helpers import get_allowed_object_ids, get_app_module, get_app_packages, has_person
from .util.frontend_helpers import get_language_cookie
......@@ -188,9 +188,7 @@ class Query(graphene.ObjectType):
celery_progress_by_task_id = graphene.Field(CeleryProgressType, task_id=graphene.String())
search_snippets = graphene.List(
SearchResultType,
query=graphene.String(),
limit=graphene.Int(required=False)
SearchResultType, query=graphene.String(), limit=graphene.Int(required=False)
)
def resolve_notifications(root, info, **kwargs):
......@@ -228,9 +226,7 @@ class Query(graphene.ObjectType):
def resolve_search_snippets(root, info, query, limit=-1, **kwargs):
indexed_models = UnifiedIndex().get_indexed_models()
allowed_object_ids = get_allowed_object_ids(info.context.user, indexed_models)
results = (
SearchQuerySet().filter(id__in=allowed_object_ids).filter(text=AutoQuery(query))
)
results = SearchQuerySet().filter(id__in=allowed_object_ids).filter(text=AutoQuery(query))
if limit < 0:
return results
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment