feat(админка): экран жалоб v2

This commit is contained in:
anor
2026-11-06 23:01:52 +10:00
parent 520b7c5a10
commit b847e6727f
10 changed files with 282 additions and 5 deletions
+4 -3
View File
@@ -128,11 +128,12 @@ def ping():
def save_feedback(username: str, tab_id: str, comment: str, answer: str,
category: str | None = None, source: str | None = None):
"""Жалоба пользователя на ответ ассистента (кнопка «сообщить об ошибке»)."""
status = "resolved" if category == "praise" else "new"
with _conn() as conn:
conn.execute(
"INSERT INTO feedback (timestamp, username, tab_id, comment, answer, category, source) "
"VALUES (?, ?, ?, ?, ?, ?, ?)",
(time.time(), username, tab_id, comment, answer, category, source),
"INSERT INTO feedback (timestamp, username, tab_id, comment, answer, category, source, status) "
"VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
(time.time(), username, tab_id, comment, answer, category, source, status),
)