mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-14 03:26:40 +07:00
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>
13 lines
398 B
Python
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:]
|