refactor firsthit

This commit is contained in:
Ivan Hörler 2018-02-01 17:05:58 +01:00
parent eb77635920
commit 43b362d466
1 changed files with 7 additions and 11 deletions

View File

@ -132,9 +132,7 @@ def article_details(request, article_id):
currencies_form = CurrenciesForm(request.POST)
print("currencies_form")
if currencies_form.is_valid():
cf = currencies_form.cleaned_data
if cf['currencies']:
selection = cf['currencies']
selection = currencies_form.cleaned_data['currencies']
request.session['currency'] = selection.id
currency_name = ExchangeRate_name.objects.get(
id=selection.id)
@ -145,9 +143,7 @@ def article_details(request, article_id):
print("add_to_cart_form")
if amount.is_valid():
print("is valid")
af = amount.cleaned_data
if af['amount']:
amount = af['amount']
amount = amount.cleaned_data['amount']
print("amount:", amount, "article_id:", article_id)
amount = AddToCartForm()
else: