init journal index in migration
This commit is contained in:
parent
3061905452
commit
6d5c0a43d4
2 changed files with 3 additions and 1 deletions
|
@ -4,6 +4,7 @@ from loguru import logger
|
|||
|
||||
from catalog.search.models import Indexer
|
||||
from common.models import JobManager
|
||||
from journal.models import JournalIndex
|
||||
from takahe.models import Config as TakaheConfig
|
||||
from takahe.models import Domain as TakaheDomain
|
||||
from takahe.models import Identity as TakaheIdentity
|
||||
|
@ -127,6 +128,7 @@ class Setup:
|
|||
|
||||
# Create search index if not exists
|
||||
Indexer.init()
|
||||
JournalIndex.instance().initialize_collection()
|
||||
|
||||
# Register cron jobs if not yet
|
||||
if settings.DISABLE_CRON_JOBS and "*" in settings.DISABLE_CRON_JOBS:
|
||||
|
|
|
@ -229,7 +229,7 @@ def clear_data_task(user_id):
|
|||
remove_data_by_user(user.identity)
|
||||
Takahe.delete_identity(user.identity.pk)
|
||||
user.clear()
|
||||
index = JournalIndex(user)
|
||||
index = JournalIndex.instance()
|
||||
index.delete_by_owner(user.identity.pk)
|
||||
logger.warning(f"User {user_str} data cleared.")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue