remotes/origin/mitri4
spacenergy 10 years ago
parent ef46459354
commit dd252beb3a
  1. 7
      main/views.py

@ -62,12 +62,19 @@ def temp_count_update(request, article):
try:
product = ProductVariation.objects.get(article__iexact=article)
count = request.GET.get('count', None)
price = request.GET.get('price', None)
if count != None:
count = count.replace(',', '.')
if int(count) < 0:
count = 0
product.in_stock = int(count)
product.save()
if price != None:
price = price.replace(',', '.')
if int(price) < 0:
price = 0
product.price = int(price)
product.save()
else:
retval['error_code'] = 1
except ProductVariation.DoesNotExist:

Loading…
Cancel
Save