do not crap out when anonymous user browses the site
This commit is contained in:
parent
d2dd113bd1
commit
a7535753a8
|
@ -15,7 +15,7 @@ def current_order(request):
|
||||||
|
|
||||||
def user_has_tickets(request):
|
def user_has_tickets(request):
|
||||||
has_tickets = False
|
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
|
tickets__product__category__pk=settings.TICKET_CATEGORY_ID
|
||||||
).exists():
|
).exists():
|
||||||
has_tickets = True
|
has_tickets = True
|
||||||
|
|
Loading…
Reference in a new issue