mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-22 09:29:30 +01:00
fix(insights): display untracked accounts on sankey by account
This commit is contained in:
@@ -13,7 +13,9 @@ from apps.insights.forms import (
|
||||
)
|
||||
|
||||
|
||||
def get_transactions(request, include_unpaid=True, include_silent=False):
|
||||
def get_transactions(
|
||||
request, include_unpaid=True, include_silent=False, include_untracked_accounts=False
|
||||
):
|
||||
transactions = Transaction.objects.all()
|
||||
|
||||
filter_type = request.GET.get("type", None)
|
||||
@@ -95,6 +97,9 @@ def get_transactions(request, include_unpaid=True, include_silent=False):
|
||||
Q(Q(category__mute=True) & ~Q(category=None)) | Q(mute=True)
|
||||
)
|
||||
|
||||
transactions = transactions.exclude(account__in=request.user.untracked_accounts.all())
|
||||
if not include_untracked_accounts:
|
||||
transactions = transactions.exclude(
|
||||
account__in=request.user.untracked_accounts.all()
|
||||
)
|
||||
|
||||
return transactions
|
||||
|
||||
@@ -74,7 +74,7 @@ def index(request):
|
||||
def sankey_by_account(request):
|
||||
# Get filtered transactions
|
||||
|
||||
transactions = get_transactions(request)
|
||||
transactions = get_transactions(request, include_untracked_accounts=True)
|
||||
|
||||
# Generate Sankey data
|
||||
sankey_data = generate_sankey_data_by_account(transactions)
|
||||
|
||||
Reference in New Issue
Block a user