diff --git a/combo/apps/lingo/models.py b/combo/apps/lingo/models.py index ab32247a..aa3648b3 100644 --- a/combo/apps/lingo/models.py +++ b/combo/apps/lingo/models.py @@ -118,6 +118,8 @@ class LingoBasketCell(CellBase): return Regie.objects.count() > 0 def is_relevant(self, context): + if not context['request'].user.is_authenticated(): + return False items = BasketItem.objects.filter( user=context['request'].user, payment_date__isnull=True ).exclude(cancellation_date__isnull=False) @@ -143,6 +145,8 @@ class LingoRecentTransactionsCell(CellBase): return Regie.objects.count() > 0 def is_relevant(self, context): + if not context['request'].user.is_authenticated(): + return False transactions = Transaction.objects.filter( user=context['request'].user, start_date__gte=timezone.now()-datetime.timedelta(days=7))