Merge branch 'cart' of git.2li.ch:ibz/web_AI-5 into cart

* 'cart' of git.2li.ch:ibz/web_AI-5:
  fix the currency calculation in the cart
  add some empty lines for better readability
This commit is contained in:
Ivan Hörler 2018-02-26 19:58:13 +01:00
commit 037df6b9bc
1 changed files with 4 additions and 1 deletions

View File

@ -232,6 +232,7 @@ def cart(request):
print('currencies currency_name:', currency_name)
else:
request.session['currency'] = None
# here we react to a change of amount per item in the Cart:
if 'amount_form' in request.POST:
amount_form = CartForm(request.POST)
@ -245,6 +246,7 @@ def cart(request):
amount,
operation
)
# here we react to a change of amount per item in the Cart:
if 'delete' in request.POST:
delete = CartForm(request.POST)
@ -273,7 +275,8 @@ def cart(request):
# enumerate the list of articles and loop over items:
for idx, cart_position in enumerate(cart_position_list):
# scrap out the details to calculate Total of item and Summ of All:
if currency:
if request.session['currency']:
currency = request.session['currency']
# get currencyname to display:
currency_name = ExchangeRate_name.objects.get(id=currency)
# get exchange_rate multiplyed: