Skip to content

Commit

Permalink
Merge pull request #33966 from dimagi/jc/fix-enterprise-dashboard-data
Browse files Browse the repository at this point in the history
Fix enterprise dashboard mobile form submission data
  • Loading branch information
jingcheng16 committed Jan 23, 2024
2 parents 0cdb012 + 4729287 commit 0dd223e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions corehq/apps/enterprise/enterprise.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
from corehq.apps.domain.calculations import sms_in_last
from corehq.apps.domain.models import Domain
from corehq.apps.es import forms as form_es
from corehq.apps.es.users import UserES
from corehq.apps.export.dbaccessors import ODataExportFetcher
from corehq.apps.reports.filters.users import \
ExpandedMobileWorkerFilter as EMWF
from corehq.apps.users.dbaccessors import (
get_all_user_rows,
get_mobile_user_count,
Expand Down Expand Up @@ -224,10 +223,9 @@ def _query(self, domain_name):
time_filter = form_es.submitted
datespan = DateSpan(datetime.now() - timedelta(days=self.window), datetime.utcnow())

users_filter = form_es.user_id(EMWF.user_es_query(domain_name,
['t__0'], # All mobile workers
self.couch_user)
.values_list('_id', flat=True))
users_filter = form_es.user_id(UserES().domain(domain_name).mobile_users().show_inactive()
.values_list('_id', flat=True))

query = (form_es.FormES()
.domain(domain_name)
.filter(time_filter(gte=datespan.startdate,
Expand Down

0 comments on commit 0dd223e

Please sign in to comment.