moved the special stuff into the inherited view

This commit is contained in:
Matthias 2021-05-06 16:29:03 +02:00
parent b09f49aaa5
commit c2a5e1fd23
2 changed files with 10 additions and 14 deletions

View File

@ -1586,3 +1586,11 @@ class LineItemPricing(PartPricing):
return None
else:
return None
def get_quantity(self):
""" Return set quantity in decimal format """
qty = Decimal(self.request.GET.get('quantity', 1))
if qty == 1:
return Decimal(self.request.POST.get('quantity', 1))
return qty

View File

@ -1959,19 +1959,7 @@ class PartPricing(AjaxView):
def get_quantity(self):
""" Return set quantity in decimal format """
# check POST
qty = self.request.POST.get('quantity', None)
# check GET
if not qty:
qty = self.request.GET.get('quantity', None)
# nothing found: return 1
if not qty:
return Decimal(1)
# return as decimal
return Decimal(qty)
return Decimal(self.request.POST.get('quantity', 1))
def get_part(self):
try: