Skip to content

Commit 00da7df

Browse files
committed
Coerce user list to a list to avoid joins
1 parent c4cd7ad commit 00da7df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kpi/serializers/v2/service_usage.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ def _get_organization_details(self):
212212
return
213213

214214
# If the user is in an organization, get all org users so we can query their total org usage
215-
self._user_ids = User.objects.values_list('pk', flat=True).filter(
216-
organizations_organization__id=organization_id
215+
self._user_ids = list(
216+
User.objects.values_list('pk', flat=True).filter(
217+
organizations_organization__id=organization_id
218+
)
217219
)
218220

219221
# If they have a subscription, use its start date to calculate beginning of current month/year's usage

0 commit comments

Comments
 (0)