diff --git a/apps/user/models.py b/apps/user/models.py index c5c6db04..f53fb977 100644 --- a/apps/user/models.py +++ b/apps/user/models.py @@ -91,7 +91,11 @@ class User(AbstractUser): @property def balance(self): - aggregate = self.balances.filter(type=0).aggregate( + aggregate = self.balances.filter( + type=0, + payment__isnull=False, + payment__status__isnull=False + ).aggregate( models.Sum('amount'), models.Sum('commission'), )