refactor firsthit
This commit is contained in:
parent
eb77635920
commit
43b362d466
|
@ -132,12 +132,10 @@ def article_details(request, article_id):
|
||||||
currencies_form = CurrenciesForm(request.POST)
|
currencies_form = CurrenciesForm(request.POST)
|
||||||
print("currencies_form")
|
print("currencies_form")
|
||||||
if currencies_form.is_valid():
|
if currencies_form.is_valid():
|
||||||
cf = currencies_form.cleaned_data
|
selection = currencies_form.cleaned_data['currencies']
|
||||||
if cf['currencies']:
|
request.session['currency'] = selection.id
|
||||||
selection = cf['currencies']
|
currency_name = ExchangeRate_name.objects.get(
|
||||||
request.session['currency'] = selection.id
|
id=selection.id)
|
||||||
currency_name = ExchangeRate_name.objects.get(
|
|
||||||
id=selection.id)
|
|
||||||
|
|
||||||
# hier wird der Artikel in den Wahrenkorb transferiert:
|
# hier wird der Artikel in den Wahrenkorb transferiert:
|
||||||
if 'amount' in request.POST:
|
if 'amount' in request.POST:
|
||||||
|
@ -145,11 +143,9 @@ def article_details(request, article_id):
|
||||||
print("add_to_cart_form")
|
print("add_to_cart_form")
|
||||||
if amount.is_valid():
|
if amount.is_valid():
|
||||||
print("is valid")
|
print("is valid")
|
||||||
af = amount.cleaned_data
|
amount = amount.cleaned_data['amount']
|
||||||
if af['amount']:
|
print("amount:", amount, "article_id:", article_id)
|
||||||
amount = af['amount']
|
amount = AddToCartForm()
|
||||||
print("amount:", amount, "article_id:", article_id)
|
|
||||||
amount = AddToCartForm()
|
|
||||||
else:
|
else:
|
||||||
amount = AddToCartForm()
|
amount = AddToCartForm()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue