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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user