Skip to content

Commit

Permalink
Add exclude extra visits from utilised budget count
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Oct 5, 2023
1 parent f344db3 commit f68d309
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commcare_connect/opportunity/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def claimed_budget(self):

@property
def utilised_budget(self):
# Todo: Exclude extra visits from this count
user_visits = UserVisit.objects.filter(opportunity=self).count()
user_visits = UserVisit.objects.filter(opportunity=self).exclude(status=VisitValidationStatus.extra).count()
return user_visits


Expand Down Expand Up @@ -200,6 +199,7 @@ class VisitValidationStatus(models.TextChoices):
pending = "pending", gettext("Pending")
approved = "approved", gettext("Approved")
rejected = "rejected", gettext("Rejected")
extra = "extra", gettext("Extra")


class Payment(models.Model):
Expand Down

0 comments on commit f68d309

Please sign in to comment.