Skip to content

Commit

Permalink
Fix check count on the actual visit_date instead of today
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Oct 11, 2023
1 parent da87e1f commit 92a105a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commcare_connect/form_receiver/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def process_deliver_form(user, xform: XForm, app: CommCareApp, opportunity: Oppo
def process_deliver_unit(user, xform: XForm, app: CommCareApp, opportunity: Opportunity, deliver_unit_block: dict):
deliver_unit = get_or_create_deliver_unit(app, deliver_unit_block)
counts = UserVisit.objects.filter(opportunity=opportunity, user=user).aggregate(
daily=Count("pk", filter=Q(visit_date__date=datetime.date.today())), total=Sum("pk", default=0)
daily=Count("pk", filter=Q(visit_date__date=xform.metadata.timeStart)), total=Sum("pk", default=0)
)
claim = OpportunityClaim.objects.filter(
opportunity_access__opportunity=opportunity, opportunity_access__user=user
Expand Down

0 comments on commit 92a105a

Please sign in to comment.