Update file metadata in manifest.json and change MinIO image source in docker-compose.yml
This commit is contained in:
@@ -5,15 +5,22 @@ from app.errors import conflict, not_found
|
||||
from app.ledger.models import Category
|
||||
|
||||
|
||||
def resolve_category_name(category: Category) -> str:
|
||||
"""Standard categories resolve to a translation key; overrides/customs are literal."""
|
||||
def resolve_category_name(category: Category) -> str | None:
|
||||
"""Literal display name, or None when the name localizes via the system key.
|
||||
|
||||
System categories serialize as a pure ``nameKey`` (for example ``savings``),
|
||||
never as a ``category.*`` prefixed string.
|
||||
"""
|
||||
if category.custom_name is not None:
|
||||
return category.custom_name
|
||||
if category.name_override is not None:
|
||||
return category.name_override
|
||||
if category.system_key is not None:
|
||||
return f"category.{category.system_key}"
|
||||
return "category.unnamed"
|
||||
return None
|
||||
|
||||
|
||||
def resolve_category_name_key(category: Category) -> str | None:
|
||||
"""Pure localization key for system categories; None for user categories."""
|
||||
return category.system_key
|
||||
|
||||
|
||||
def get_income_source(db: Session, *, space_id, income_source_id) -> IncomeSource:
|
||||
|
||||
Reference in New Issue
Block a user