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:
Pirmin Hinderling (fedora)
2026-07-07 22:50:53 +02:00
parent 28aab3b16a
commit 16428f2c16
19 changed files with 237 additions and 101 deletions
+8 -6
View File
@@ -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)