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:
parent
377ea8c45d
commit
f39737d624
1 changed files with 4 additions and 1 deletions
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue