Skip to content

Commit

Permalink
fix balance metrics regarding users with no transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Feb 13, 2024
1 parent 9b0007b commit 5c8aac9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vinywaji/metrics/async_instruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def calc_transaction_aggregates(_options: CallbackOptions) -> Iterable[Observati
def calc_balances(_options: CallbackOptions) -> Iterable[Observation]:
# aggregate all negative transactions
balances = [
i["current_balance"]
i["current_balance"] or 0
for i in models.User.objects.all().annotate(current_balance=Sum("transactions__amount")).values()
]

Expand Down

0 comments on commit 5c8aac9

Please sign in to comment.