mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Simplify logic to get default search model. Remove unused import
This commit is contained in:
parent
2b35790165
commit
ac21b10dd5
2 changed files with 2 additions and 5 deletions
|
@ -476,11 +476,9 @@ def get_default_search_model() -> SearchModelConfig:
|
||||||
|
|
||||||
if default_search_model:
|
if default_search_model:
|
||||||
return default_search_model
|
return default_search_model
|
||||||
elif SearchModelConfig.objects.count() > 0:
|
elif SearchModelConfig.objects.count() == 0:
|
||||||
return SearchModelConfig.objects.first()
|
|
||||||
else:
|
|
||||||
SearchModelConfig.objects.create()
|
SearchModelConfig.objects.create()
|
||||||
return SearchModelConfig.objects.filter(name="default").first()
|
return SearchModelConfig.objects.first()
|
||||||
|
|
||||||
|
|
||||||
def get_user_default_search_model(user: KhojUser = None) -> SearchModelConfig:
|
def get_user_default_search_model(user: KhojUser = None) -> SearchModelConfig:
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
import random
|
import random
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue