bornhack-website/shop/context_processors.py

13 lines
260 B
Python
Raw Normal View History

def current_order(request):
if request.user.is_authenticated():
order = None
2016-05-15 22:09:00 +00:00
orders = request.user.orders.filter(open__isnull=False)
if orders:
order = orders[0]
return {'current_order': order}
return {}