hide combo cell types if no regie are defined
This commit is contained in:
parent
dc64004913
commit
67ea2a61d0
|
@ -102,6 +102,10 @@ class LingoBasketCell(CellBase):
|
|||
class Meta:
|
||||
verbose_name = _('Basket')
|
||||
|
||||
@classmethod
|
||||
def is_enabled(cls):
|
||||
return Regie.objects.count() > 0
|
||||
|
||||
def is_relevant(self, context):
|
||||
items = BasketItem.objects.filter(
|
||||
user=context['request'].user, payment_date__isnull=True
|
||||
|
@ -123,6 +127,10 @@ class LingoRecentTransactionsCell(CellBase):
|
|||
class Meta:
|
||||
verbose_name = _('Recent Transactions')
|
||||
|
||||
@classmethod
|
||||
def is_enabled(cls):
|
||||
return Regie.objects.count() > 0
|
||||
|
||||
def is_relevant(self, context):
|
||||
transactions = Transaction.objects.filter(
|
||||
user=context['request'].user,
|
||||
|
|
Reference in New Issue