Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aperag/tasks/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def update_index_for_document(self, document_id):
document.save()

try:
relate_ids = json.loads(document.relate_ids)
relate_ids = json.loads(document.relate_ids) if document.relate_ids.strip() else {}
source = get_source(json.loads(document.collection.config))
metadata = json.loads(document.metadata)
local_doc = source.prepare_document(name=document.name, metadata=metadata)
Expand Down
2 changes: 1 addition & 1 deletion aperag/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ async def update_document(
# if user add labels for a document, we need to update index
update_index_for_document.delay(instance.id)

related_questions = await sync_to_async(document.question_set.exclude)(status=QuestionStatus.DELETED)
related_questions = await sync_to_async(instance.question_set.exclude)(status=QuestionStatus.DELETED)
async for question in related_questions:
question.status = QuestionStatus.WARNING
await question.asave()
Expand Down
Loading
Loading