Features: 1) Add check for is_active status before updating vendor stock;

Fixes: 1) Prevent potential errors by skipping inactive vendors;

Extra: None;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-08-05 10:36:43 +03:00
parent 377ea8c45d
commit f39737d624

View file

@ -43,7 +43,10 @@ def update_products_task():
for vendor_class in vendors_classes:
vendor = vendor_class()
try:
vendor.update_stock()
if vendor.is_active:
vendor.update_stock()
else:
continue
except Exception as e:
logger.warning(f"Skipping {vendor_class} due to error: {e!s}")