mirror of
https://github.com/kjanat/livegraphs-django.git
synced 2026-02-13 12:55:42 +01:00
chore(deps): update pre-commit config and apply bulk formatting
- build(pre-commit): upgrade hooks (django-upgrade 1.29.1, uv 0.9.7, ruff 0.14.3, bandit 1.8.6) - build(pre-commit): add uv-lock hook, tombi TOML formatter, prettier-plugin-packagejson - build(pre-commit): disable Django check hooks (commented out) - build(pre-commit): switch npx → bunx for prettier execution - build(node): add bun.lock, update prettier config with schema + packagejson plugin - style: apply ruff format to all Python files (comments, spacing, imports) - style: apply prettier format to all JS/CSS files (comment styles, spacing) - style: apply tombi format to pyproject.toml (reordered sections, consistent formatting) - chore: remove emoji from bash script comments for consistency BREAKING CHANGE: Django check and migration check hooks disabled in pre-commit config
This commit is contained in:
@@ -91,51 +91,47 @@ def export_chats_csv(request):
|
||||
writer = csv.writer(response)
|
||||
|
||||
# Write CSV header
|
||||
writer.writerow(
|
||||
[
|
||||
"Session ID",
|
||||
"Start Time",
|
||||
"End Time",
|
||||
"IP Address",
|
||||
"Country",
|
||||
"Language",
|
||||
"Messages Sent",
|
||||
"Sentiment",
|
||||
"Escalated",
|
||||
"Forwarded HR",
|
||||
"Full Transcript",
|
||||
"Avg Response Time (s)",
|
||||
"Tokens",
|
||||
"Tokens EUR",
|
||||
"Category",
|
||||
"Initial Message",
|
||||
"User Rating",
|
||||
]
|
||||
)
|
||||
writer.writerow([
|
||||
"Session ID",
|
||||
"Start Time",
|
||||
"End Time",
|
||||
"IP Address",
|
||||
"Country",
|
||||
"Language",
|
||||
"Messages Sent",
|
||||
"Sentiment",
|
||||
"Escalated",
|
||||
"Forwarded HR",
|
||||
"Full Transcript",
|
||||
"Avg Response Time (s)",
|
||||
"Tokens",
|
||||
"Tokens EUR",
|
||||
"Category",
|
||||
"Initial Message",
|
||||
"User Rating",
|
||||
])
|
||||
|
||||
# Write data rows
|
||||
for session in sessions:
|
||||
writer.writerow(
|
||||
[
|
||||
session.session_id,
|
||||
session.start_time,
|
||||
session.end_time,
|
||||
session.ip_address,
|
||||
session.country,
|
||||
session.language,
|
||||
session.messages_sent,
|
||||
session.sentiment,
|
||||
"Yes" if session.escalated else "No",
|
||||
"Yes" if session.forwarded_hr else "No",
|
||||
session.full_transcript,
|
||||
session.avg_response_time,
|
||||
session.tokens,
|
||||
session.tokens_eur,
|
||||
session.category,
|
||||
session.initial_msg,
|
||||
session.user_rating,
|
||||
]
|
||||
)
|
||||
writer.writerow([
|
||||
session.session_id,
|
||||
session.start_time,
|
||||
session.end_time,
|
||||
session.ip_address,
|
||||
session.country,
|
||||
session.language,
|
||||
session.messages_sent,
|
||||
session.sentiment,
|
||||
"Yes" if session.escalated else "No",
|
||||
"Yes" if session.forwarded_hr else "No",
|
||||
session.full_transcript,
|
||||
session.avg_response_time,
|
||||
session.tokens,
|
||||
session.tokens_eur,
|
||||
session.category,
|
||||
session.initial_msg,
|
||||
session.user_rating,
|
||||
])
|
||||
|
||||
return response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user