From dd252beb3afa4986587493cf771a710d20d7f106 Mon Sep 17 00:00:00 2001 From: spacenergy Date: Wed, 21 Oct 2015 21:37:01 +0600 Subject: [PATCH] auto --- main/views.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main/views.py b/main/views.py index ad835b0..62578aa 100644 --- a/main/views.py +++ b/main/views.py @@ -47,7 +47,7 @@ def size_sargan(request): def size_omer_sporasub(request): return render(request, 'size/omer_sporasub.jinja') - + def size_aqua_discovery(request): return render(request, 'size/aqua_discovery.jinja') @@ -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: @@ -87,4 +94,4 @@ def feedback(request): return render(request, 'feedback.jinja', dict( object_list=Feedback.objects.order_by('-pk'), form=form - )) \ No newline at end of file + ))