From 0f65111b53f6fb5be96ab55373397fcddb5d6aa3 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 17 Jun 2025 11:17:40 +0300 Subject: [PATCH] Fixes: 1) Correct iteration over related objects in `fix_prices` command using `.all()` instead of direct access; Extra: None; --- core/management/commands/fix_prices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/management/commands/fix_prices.py b/core/management/commands/fix_prices.py index 5d3c1dab..2ecadc6d 100644 --- a/core/management/commands/fix_prices.py +++ b/core/management/commands/fix_prices.py @@ -13,7 +13,7 @@ class Command(BaseCommand): self.stdout.write(self.style.SUCCESS("Starting fixing stocks' prices...")) for product in Product.objects.filter(stocks__isnull=False): - for stock in product.stocks: + for stock in product.stocks.all(): try: stock.price = AbstractVendor.round_price_marketologically(stock.price) stock.save()