mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Remove unused db adapter methods, like for fact checker data store
This commit is contained in:
parent
10bca6fa8f
commit
536fe994be
1 changed files with 0 additions and 27 deletions
|
@ -24,7 +24,6 @@ import cron_descriptor
|
||||||
from apscheduler.job import Job
|
from apscheduler.job import Job
|
||||||
from asgiref.sync import sync_to_async
|
from asgiref.sync import sync_to_async
|
||||||
from django.contrib.sessions.backends.db import SessionStore
|
from django.contrib.sessions.backends.db import SessionStore
|
||||||
from django.db import models
|
|
||||||
from django.db.models import Prefetch, Q
|
from django.db.models import Prefetch, Q
|
||||||
from django.db.models.manager import BaseManager
|
from django.db.models.manager import BaseManager
|
||||||
from django.db.utils import IntegrityError
|
from django.db.utils import IntegrityError
|
||||||
|
@ -38,7 +37,6 @@ from khoj.database.models import (
|
||||||
ChatModelOptions,
|
ChatModelOptions,
|
||||||
ClientApplication,
|
ClientApplication,
|
||||||
Conversation,
|
Conversation,
|
||||||
DataStore,
|
|
||||||
Entry,
|
Entry,
|
||||||
FileObject,
|
FileObject,
|
||||||
GithubConfig,
|
GithubConfig,
|
||||||
|
@ -506,18 +504,6 @@ async def aget_user_name(user: KhojUser):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
async def set_text_content_config(user: KhojUser, object: Type[models.Model], updated_config):
|
|
||||||
deduped_files = list(set(updated_config.input_files)) if updated_config.input_files else None
|
|
||||||
deduped_filters = list(set(updated_config.input_filter)) if updated_config.input_filter else None
|
|
||||||
await object.objects.filter(user=user).adelete()
|
|
||||||
await object.objects.acreate(
|
|
||||||
input_files=deduped_files,
|
|
||||||
input_filter=deduped_filters,
|
|
||||||
index_heading_entries=updated_config.index_heading_entries,
|
|
||||||
user=user,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@arequire_valid_user
|
@arequire_valid_user
|
||||||
async def set_user_github_config(user: KhojUser, pat_token: str, repos: list):
|
async def set_user_github_config(user: KhojUser, pat_token: str, repos: list):
|
||||||
config = await GithubConfig.objects.filter(user=user).afirst()
|
config = await GithubConfig.objects.filter(user=user).afirst()
|
||||||
|
@ -857,19 +843,6 @@ class PublicConversationAdapters:
|
||||||
return f"/share/chat/{public_conversation.slug}/"
|
return f"/share/chat/{public_conversation.slug}/"
|
||||||
|
|
||||||
|
|
||||||
class DataStoreAdapters:
|
|
||||||
@staticmethod
|
|
||||||
async def astore_data(data: dict, key: str, user: KhojUser, private: bool = True):
|
|
||||||
if await DataStore.objects.filter(key=key).aexists():
|
|
||||||
return key
|
|
||||||
await DataStore.objects.acreate(value=data, key=key, owner=user, private=private)
|
|
||||||
return key
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
async def aretrieve_public_data(key: str):
|
|
||||||
return await DataStore.objects.filter(key=key, private=False).afirst()
|
|
||||||
|
|
||||||
|
|
||||||
class ConversationAdapters:
|
class ConversationAdapters:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def make_public_conversation_copy(conversation: Conversation):
|
def make_public_conversation_copy(conversation: Conversation):
|
||||||
|
|
Loading…
Reference in a new issue