Skip to content

Commit

Permalink
Use submitted_by common tag
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswambua committed Nov 18, 2021
1 parent 2c7d116 commit 1a45d85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions onadata/libs/data/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from django.conf import settings
from django.db import connection

from onadata.libs.utils.common_tags import SUBMISSION_TIME
from onadata.libs.utils.common_tags import (
SUBMISSION_TIME, SUBMITTED_BY)
from onadata.apps.logger.models.data_view import DataView


Expand Down Expand Up @@ -93,7 +94,7 @@ def _postgres_count_group(field, name, xform, data_view=None):
additional_filters = _additional_data_view_filters(data_view)

# Use left join to the auth user model for better performance.
if field == "_submitted_by":
if field == SUBMITTED_BY:
string_args["json"] = "au.username"
string_args["join"] = "i LEFT JOIN auth_user au ON au.id = i.user_id"

Expand Down

0 comments on commit 1a45d85

Please sign in to comment.