From 92d81d3b16829d91a80289f8fad90f464c1b9e9a Mon Sep 17 00:00:00 2001 From: sabaimran <65192171+sabaimran@users.noreply.github.com> Date: Mon, 3 Jul 2023 11:32:44 -0700 Subject: [PATCH] Initialize the search.model field to SearchModels() and fix Reinitialize API call (#273) --- src/khoj/configure.py | 3 +++ src/khoj/interface/web/config.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/khoj/configure.py b/src/khoj/configure.py index a1e07205..ecd8345e 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -92,6 +92,9 @@ def configure_search(model: SearchModels, config: FullConfig, regenerate: bool, logger.warning("🚨 No Content or Search type is configured.") return + if model is None: + model = SearchModels() + try: # Initialize Org Notes Search if (t == state.SearchType.Org or t == None) and config.content_type.org and config.search_type.asymmetric: diff --git a/src/khoj/interface/web/config.html b/src/khoj/interface/web/config.html index e6f2982f..2822efff 100644 --- a/src/khoj/interface/web/config.html +++ b/src/khoj/interface/web/config.html @@ -253,7 +253,7 @@ reinitialize.disabled = true; reinitialize.innerHTML = "Reinitializing..."; const csrfToken = document.cookie.split('; ').find(row => row.startsWith('csrftoken'))?.split('=')[1]; - fetch('/api/update?&client=web?force=true', { + fetch('/api/update?&client=web&force=True', { method: 'GET', headers: { 'Content-Type': 'application/json',