multi-checkout stub
This commit is contained in:
parent
756246ba46
commit
c3d3b208af
|
@ -99,12 +99,14 @@ def checkout(request):
|
|||
except KeyError as ex:
|
||||
return HttpResponse(status=400)
|
||||
|
||||
count = request.REQUEST.get('count', 1)
|
||||
count = int(request.REQUEST.get('count', 1))
|
||||
drink_data = get_drink(drink)
|
||||
|
||||
ctx = {
|
||||
'heading': 'Codes scanned: user=%r drink=%r amount=%s' % (user, drink, count),
|
||||
'drinker': get_user(user),
|
||||
'drink': get_drink(drink),
|
||||
'drink': drink_data,
|
||||
'total': drink_data.prize * count,
|
||||
}
|
||||
return render(request, 'checkout.html', ctx)
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
<h1>{{ heading }}</h1>
|
||||
|
||||
<h2>
|
||||
{{drinker.name}} spends {{drink.prize}} units on {{drink.name}}.
|
||||
{{drinker.name}} spends {{total}} units on {{drink.name}}.
|
||||
</h2>
|
||||
{% endblock %}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</h2>
|
||||
|
||||
<h2>
|
||||
Have one of these for {{drink.prize}} credits:
|
||||
Have some of these for {{drink.prize}} credits each:
|
||||
</h2>
|
||||
|
||||
{% for drinker in drinkers %}
|
||||
|
|
Loading…
Reference in New Issue