diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b2442280..77d4ec6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,12 +4,6 @@ repos: hooks: - id: black -# - repo: https://github.com/pycqa/isort -# rev: 5.12.0 -# hooks: -# - id: isort -# name: isort (python) - - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 17c11e77..63a50fac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,6 +128,9 @@ warn_unused_ignores = false [tool.black] line-length = 120 +[tool.isort] +profile = "black" + [tool.pytest.ini_options] addopts = "--strict-markers" markers = [ diff --git a/src/khoj/routers/indexer.py b/src/khoj/routers/indexer.py index 00303f31..6fcf3348 100644 --- a/src/khoj/routers/indexer.py +++ b/src/khoj/routers/indexer.py @@ -1,4 +1,3 @@ -# Standard Packages import asyncio import logging from typing import Dict, Optional, Union @@ -175,6 +174,9 @@ def configure_content( content_index = ContentIndex() success = True + if t == None: + t = state.SearchType.All + if t is not None and t in [type.value for type in state.SearchType]: t = state.SearchType(t) @@ -301,7 +303,7 @@ def configure_content( # Initialize Notion Search notion_config = NotionConfig.objects.filter(user=user).first() if ( - search_type == state.SearchType.All.value or search_type in state.SearchType.Notion.value + search_type == state.SearchType.All.value or search_type == state.SearchType.Notion.value ) and notion_config: logger.info("🔌 Setting up search for notion") text_search.setup( @@ -314,7 +316,7 @@ def configure_content( ) except Exception as e: - logger.error(f"🚨 Failed to setup GitHub: {e}", exc_info=True) + logger.error(f"🚨 Failed to setup Notion: {e}", exc_info=True) success = False # Invalidate Query Cache