refactor: derive VK description postfix from measure_name, drop global postfix setting

Each product's description is now built as "Name (цена за M.)" using its
own measure_name. The global description_postfix setting is removed —
it couldn't handle per-product units.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-05-12 23:08:45 +03:00
parent e169a91146
commit 02abddc587
5 changed files with 11 additions and 26 deletions

View File

@@ -153,8 +153,8 @@ def _sync_product(
name = _name_for_vk(product.name)
multiplier = float(sync_config.price_multiplier) if sync_config and sync_config.price_multiplier else 1.0
price_rubles = _calc_price(product.price) * multiplier
postfix = (sync_config.description_postfix or "").strip() if sync_config else ""
desc = f"{product.name} ({postfix})" if postfix else product.name
measure = (product.measure_name or "").strip()
desc = f"{product.name} (цена за {measure}.)" if measure else product.name
stock = settings.VK_STOCK_AMOUNT if product.allow_to_sell else 0
owner_id = f"-{vk_group_id}"
now = _now()