add a user object to the checkout view

This commit is contained in:
Andreas Zweili 2018-02-25 14:20:59 +01:00
parent 5b1530c0bd
commit f36550e9d4
2 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,7 @@
{% block content %}
<h3>Preview your Purchase:</h3>
<h4>Shipping Address:</h4>
{% if user_list %}
{% if person %}
<p><b>Salutation: </b>{{ person.salutation }}</p>
<p><b>Firstname: </b>{{ request.user.first_name }}</p>
<p><b>Lastname: </b>{{ request.user.last_name }}</p>

View File

@ -405,6 +405,7 @@ def checkout(request):
checkout_form = CheckoutForm()
registration_form = RegistrationForm()
person = Person.objects.get(user=request.user.id)
return render(request, 'webshop/cart.html',
{'cart_position_list_zip': cart_position_list_zip,
@ -418,4 +419,5 @@ def checkout(request):
'currency_name': currency_name,
'category_list': category_list,
'message': message,
'person': person
})