fix(db): Delete unused value of name

This commit is contained in:
Black_Raven committed 2026-07-26 19:07:21 +03:00
1 parent 30c81e5aa5
commit 0a6418d84d
4 files changed
+39 -23

No files matched your search

+3 -15
View File
@@ -63,11 +63,8 @@ def parse_product_data(product_text):
else:
length = 0
short_name = f"Труба ПВХ {diameter}мм {application_type} {length}мм" if diameter else product_text[:50]
return {
'short_name': short_name,
'full_name': product_text,
'name': product_text,
'diameter': diameter,
'wall_thickness': wall_thickness,
'length': length,
@@ -96,14 +93,6 @@ def add_product(conn, product_text, category_id, image_path=None,
application_type = application_type or product_data['application_type']
stiffness_class = stiffness_class or product_data['stiffness_class']
# Формируем короткое имя
if diameter and length:
name = f"Труба ПВХ {diameter}мм {application_type} {length}мм"
elif fitting_type and diameter:
name = f"{fitting_type.capitalize()} ПВХ {diameter}мм"
else:
name = product_text[:100]
# Формируем описание
description_parts = []
if fitting_type:
@@ -127,12 +116,11 @@ def add_product(conn, product_text, category_id, image_path=None,
try:
cursor.execute('''
INSERT INTO products (
name, full_name, description, category_id,
name, description, category_id,
diameter, wall_thickness, length, color,
application_type, stiffness_class, image_path
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
''', (
name,
product_text,
description,
category_id,