do not crap out when anonymous user browses the site

This commit is contained in:
Thomas Steen Rasmussen 2016-05-31 10:58:52 +02:00
parent d2dd113bd1
commit a7535753a8

View file

@ -15,7 +15,7 @@ def current_order(request):
def user_has_tickets(request):
has_tickets = False
if request.user.orders.filter(
if hasattr(request.user, 'orders') and request.user.orders.filter(
tickets__product__category__pk=settings.TICKET_CATEGORY_ID
).exists():
has_tickets = True