Replace counter-arguments with possible answers and unify search inputs.
Models, AI assistant, and UI now show diskussionsfertige Antworten without titles; shared search partial fixes aria-label rendering. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import uuid
|
||||
from django.db import transaction
|
||||
from django.utils.text import slugify
|
||||
|
||||
from claims.models import Category, Claim, CounterArgument, EvidenceFile, Source, Tag
|
||||
from claims.models import Category, Claim, EvidenceFile, PossibleAnswer, Source, Tag
|
||||
|
||||
|
||||
class DraftPublishError(Exception):
|
||||
@@ -72,11 +72,13 @@ def publish_draft(draft):
|
||||
description=source.get('description', ''),
|
||||
)
|
||||
|
||||
for counter in draft.counter_arguments or []:
|
||||
argument = (counter.get('argument') or '').strip()
|
||||
response = (counter.get('response') or '').strip()
|
||||
if argument and response:
|
||||
CounterArgument.objects.create(claim=claim, argument=argument, response=response)
|
||||
for item in draft.possible_answers or []:
|
||||
if isinstance(item, str):
|
||||
answer = item.strip()
|
||||
else:
|
||||
answer = (item.get('answer') or item.get('response') or '').strip()
|
||||
if answer:
|
||||
PossibleAnswer.objects.create(claim=claim, answer=answer)
|
||||
|
||||
if draft.uploaded_file:
|
||||
_attach_uploaded_file(draft, claim)
|
||||
|
||||
Reference in New Issue
Block a user