From 3c652febe30754646b781f48559a09513a8c6e2d Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Wed, 28 Jan 2026 21:52:57 +0300 Subject: [PATCH] chore(core): remove obsolete price fixing command and update .gitignore Removed the unused `fix_prices` management command to clean up legacy code. Updated `.gitignore` to include vendor documentation files, ensuring the directory is consistent in version control. --- .gitignore | 1 + engine/core/management/commands/fix_prices.py | 28 ------------------- engine/core/vendors/docs/.gitkeep | 0 3 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 engine/core/management/commands/fix_prices.py create mode 100644 engine/core/vendors/docs/.gitkeep diff --git a/.gitignore b/.gitignore index fcab97ea..c9d46f23 100644 --- a/.gitignore +++ b/.gitignore @@ -188,6 +188,7 @@ test.ipynb .scrapy .cover .pybuilder/ +engine/core/vendors/docs/* # Production .initialized diff --git a/engine/core/management/commands/fix_prices.py b/engine/core/management/commands/fix_prices.py deleted file mode 100644 index 6076db78..00000000 --- a/engine/core/management/commands/fix_prices.py +++ /dev/null @@ -1,28 +0,0 @@ -import logging -from typing import Any - -from django.core.management.base import BaseCommand - -from engine.core.models import Product -from engine.core.vendors import AbstractVendor - -logger = logging.getLogger(__name__) - - -class Command(BaseCommand): - def handle(self, *args: list[Any], **options: dict[Any, Any]) -> None: - self.stdout.write(self.style.SUCCESS("Starting fixing stocks' prices...")) - - for product in Product.objects.filter(stocks__isnull=False): - for stock in product.stocks.all(): - try: - stock.price = AbstractVendor.round_price_marketologically( - stock.price - ) - stock.save() - except Exception as e: - self.stdout.write( - self.style.WARNING(f"Couldn't fix price on {stock.uuid}") - ) - self.stdout.write(self.style.WARNING(f"Error: {e}")) - self.stdout.write(self.style.SUCCESS("Successfully fixed stocks' prices!")) diff --git a/engine/core/vendors/docs/.gitkeep b/engine/core/vendors/docs/.gitkeep new file mode 100644 index 00000000..e69de29b