Files
aurum/backend/app/core/text.py
ZProger 6cc532378b feat: auto-capitalize the first letter of transaction descriptions
Transactions/recurring templates entered with mixed casing ("траты на
продукты") are now capitalized on create/update via a Pydantic validator,
so the fix applies to every client, not just the web UI. Adds a one-off
backfill script for existing rows.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 23:10:22 +03:00

13 lines
398 B
Python

"""Shared text-formatting helpers."""
def capitalize_first_letter(value: str) -> str:
"""Uppercase the first character, leaving the rest of the string untouched.
Unlike str.capitalize()/str.title(), this never lowercases the rest of the
string — "iPhone 15" stays "iPhone 15", not "Iphone 15".
"""
if not value:
return value
return value[0].upper() + value[1:]