Fixes: 1) Correct iteration over related objects in fix_prices command using .all() instead of direct access;
Extra: None;
This commit is contained in:
parent
6ee3870ab0
commit
0f65111b53
1 changed files with 1 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ class Command(BaseCommand):
|
||||||
self.stdout.write(self.style.SUCCESS("Starting fixing stocks' prices..."))
|
self.stdout.write(self.style.SUCCESS("Starting fixing stocks' prices..."))
|
||||||
|
|
||||||
for product in Product.objects.filter(stocks__isnull=False):
|
for product in Product.objects.filter(stocks__isnull=False):
|
||||||
for stock in product.stocks:
|
for stock in product.stocks.all():
|
||||||
try:
|
try:
|
||||||
stock.price = AbstractVendor.round_price_marketologically(stock.price)
|
stock.price = AbstractVendor.round_price_marketologically(stock.price)
|
||||||
stock.save()
|
stock.save()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue