diff --git a/src/khoj/configure.py b/src/khoj/configure.py index 3aa39f10..1b3feea8 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -253,7 +253,7 @@ def save_chat_session(): @schedule.repeat(schedule.every(59).minutes) def upload_telemetry(): - if not state.config.app.should_log_telemetry or not state.telemetry: + if not state.config or not state.config.app.should_log_telemetry or not state.telemetry: message = "📡 No telemetry to upload" if not state.telemetry else "📡 Telemetry logging disabled" logger.debug(message) return diff --git a/src/khoj/routers/web_client.py b/src/khoj/routers/web_client.py index 82bc7336..1ca57579 100644 --- a/src/khoj/routers/web_client.py +++ b/src/khoj/routers/web_client.py @@ -65,9 +65,10 @@ def content_config_page(request: Request, content_type: str): compressed_jsonl=default_content_type["compressed-jsonl"], embeddings_file=default_content_type["embeddings-file"], ) + current_config = ( state.config.content_type[content_type] - if state.config and state.config.content_type and content_type in state.config.content_type + if state.config and state.config.content_type and state.config.content_type[content_type] # type: ignore else default_config ) current_config = json.loads(current_config.json())