From 44101d656d3d084f816991b73c41b00a0584360c Mon Sep 17 00:00:00 2001 From: Alex Dusenbery Date: Tue, 27 Nov 2018 09:41:55 -0500 Subject: [PATCH] Pick a better ordering field for CourseEnrollmentPagination in grades API. --- lms/djangoapps/courseware/tests/test_access.py | 2 +- lms/djangoapps/discussion/tests/test_views.py | 2 +- lms/djangoapps/django_comment_client/base/tests.py | 2 +- lms/djangoapps/grades/api/v1/views.py | 4 ++-- openedx/core/djangoapps/config_model_utils/models.py | 2 -- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lms/djangoapps/courseware/tests/test_access.py b/lms/djangoapps/courseware/tests/test_access.py index 3547eff232..880c16ce02 100644 --- a/lms/djangoapps/courseware/tests/test_access.py +++ b/lms/djangoapps/courseware/tests/test_access.py @@ -29,7 +29,7 @@ from courseware.tests.factories import ( from courseware.tests.helpers import LoginEnrollmentTestCase, masquerade_as_group_member from lms.djangoapps.ccx.models import CustomCourseForEdX from openedx.core.djangoapps.content.course_overviews.models import CourseOverview -from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES, override_waffle_flag +from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES from openedx.core.lib.tests import attr from openedx.features.content_type_gating.models import ContentTypeGatingConfig from student.models import CourseEnrollment diff --git a/lms/djangoapps/discussion/tests/test_views.py b/lms/djangoapps/discussion/tests/test_views.py index 0e22f02d2e..b239c23b1f 100644 --- a/lms/djangoapps/discussion/tests/test_views.py +++ b/lms/djangoapps/discussion/tests/test_views.py @@ -45,7 +45,7 @@ from openedx.core.djangoapps.course_groups.models import CourseUserGroup from openedx.core.djangoapps.course_groups.tests.helpers import config_course_cohorts from openedx.core.djangoapps.course_groups.tests.test_views import CohortViewsTestCase from openedx.core.djangoapps.util.testing import ContentGroupTestCase -from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES, override_waffle_flag +from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES from openedx.features.content_type_gating.models import ContentTypeGatingConfig from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseTestConsentRequired from student.roles import CourseStaffRole, UserBasedRole diff --git a/lms/djangoapps/django_comment_client/base/tests.py b/lms/djangoapps/django_comment_client/base/tests.py index a60b37edf1..a80544e2dd 100644 --- a/lms/djangoapps/django_comment_client/base/tests.py +++ b/lms/djangoapps/django_comment_client/base/tests.py @@ -37,7 +37,7 @@ from lms.djangoapps.teams.tests.factories import CourseTeamFactory, CourseTeamMe from lms.lib.comment_client import Thread from openedx.core.djangoapps.course_groups.cohorts import set_course_cohorted from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory -from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES, override_waffle_flag +from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES from openedx.core.lib.tests import attr from student.roles import CourseStaffRole, UserBasedRole from student.tests.factories import CourseAccessRoleFactory, CourseEnrollmentFactory, UserFactory diff --git a/lms/djangoapps/grades/api/v1/views.py b/lms/djangoapps/grades/api/v1/views.py index 7928e36085..2ef1a412e2 100644 --- a/lms/djangoapps/grades/api/v1/views.py +++ b/lms/djangoapps/grades/api/v1/views.py @@ -111,8 +111,8 @@ class CourseEnrollmentPagination(CursorPagination): """ Paginates over CourseEnrollment objects. """ - page_size = 25 - ordering = 'created' + page_size = 50 + ordering = 'id' class PaginatedAPIView(APIView): diff --git a/openedx/core/djangoapps/config_model_utils/models.py b/openedx/core/djangoapps/config_model_utils/models.py index eb3e850388..74529f41b3 100644 --- a/openedx/core/djangoapps/config_model_utils/models.py +++ b/openedx/core/djangoapps/config_model_utils/models.py @@ -7,8 +7,6 @@ StackedConfigurationModel: A ConfigurationModel that can be overridden at site, # -*- coding: utf-8 -*- from __future__ import unicode_literals -from collections import namedtuple - from django.conf import settings from django.db import models from django.db.models import Q, F