Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaults for context vars #36

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions oarepo_global_search/services/records/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def indices(self):
for service_dict in self.service_mapping:
service = list(service_dict.keys())[0]
indices.append(service.record_cls.index.search_alias)
if current_action.get() == "search_drafts" and getattr(service, "draft_cls", None):
if current_action.get("search") == "search_drafts" and getattr(service, "draft_cls", None):
indices.append(service.draft_cls.index.search_alias)
return indices

Expand Down Expand Up @@ -99,7 +99,7 @@ def service_mapping(self):

@property
def config(self):
stored_config = current_config.get()
stored_config = current_config.get(None)
if stored_config:
return stored_config

Expand All @@ -112,7 +112,7 @@ def config(self):
GlobalSearchOptions.sort_default = search_opts["sort_default"]
GlobalSearchOptions.sort_default_no_query = search_opts["sort_default_no_query"]

if current_action.get() == "search_drafts":
if current_action.get("search") == "search_drafts":
url_prefix = '/user/search'
links_search = pagination_links("{+api}/user/search{?args*}")
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

[metadata]
name = oarepo-global-search
version = 1.0.30
version = 1.0.31
description = "A model builder plugin for global search"
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
Loading