Skip to content

Commit

Permalink
fix: updating group members with aggregate pagination num pages
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sheehan-edx committed May 8, 2024
1 parent bdb906f commit 70f5d88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions enterprise_access/apps/api/v1/views/subsidy_access_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
REST API views for the subsidy_access_policy app.
"""
import logging
import math
import os
from collections import defaultdict
from contextlib import suppress
Expand Down Expand Up @@ -123,6 +124,9 @@ def _update_pagination_params_for_group_aggregates(
member_response['next'] = None
member_response['previous'] = None

if sort_by_enrollment_count:
member_response['num_pages'] = math.ceil(num_member_results / GROUP_MEMBERS_WITH_AGGREGATES_DEFAULT_PAGE_SIZE)


def zip_group_members_data_with_enrollment_count(member_results, subsidy_learner_aggregate_dict):
"""Helper method to zip group member results with aggregate data from the subsidy service"""
Expand Down

0 comments on commit 70f5d88

Please sign in to comment.