fix: register clone task and sanitize cloned content

This commit is contained in:
CREDO23 2026-01-26 21:01:36 +02:00
parent 271de96cce
commit 1c98ba989d
2 changed files with 3 additions and 1 deletions

View file

@ -65,6 +65,7 @@ celery_app = Celery(
"app.tasks.celery_tasks.schedule_checker_task",
"app.tasks.celery_tasks.blocknote_migration_tasks",
"app.tasks.celery_tasks.document_reindex_tasks",
"app.tasks.celery_tasks.clone_chat_tasks",
],
)

View file

@ -253,6 +253,7 @@ async def clone_public_chat(
Clone a public chat to user's account.
Creates a new private thread with all messages and podcasts.
Citations are stripped since they reference the original user's documents.
"""
import copy
@ -291,7 +292,7 @@ async def clone_public_chat(
podcast_id_map: dict[int, int] = {}
for msg in sorted(source_thread.messages, key=lambda m: m.created_at):
new_content = copy.deepcopy(msg.content)
new_content = sanitize_content_for_public(msg.content)
if isinstance(new_content, list):
for part in new_content: