diff --git a/core/vendors/__init__.py b/core/vendors/__init__.py index 6c3c4b8e..519a9915 100644 --- a/core/vendors/__init__.py +++ b/core/vendors/__init__.py @@ -301,6 +301,7 @@ class AbstractVendor: raise ValueError(f"Invalid method {method!r} for products update...") def delete_inactives(self, inactivation_method: str = "deactivate", size: int = 5000): + filter_kwargs: dict[str, Any] = {} # noinspection PyUnreachableCode match inactivation_method: case "deactivate": @@ -311,9 +312,7 @@ class AbstractVendor: raise ValueError(f"Invalid method {inactivation_method!r} for products cleaner...") while True: - batch_ids = list(self.get_products_queryset() - .filter(**filter_kwargs) - .values_list("pk", flat=True)[:size]) + batch_ids = list(self.get_products_queryset().filter(**filter_kwargs).values_list("pk", flat=True)[:size]) if not batch_ids: break with suppress(Exception):