-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow course entitlements REST API to be filtered on course_uuid #32305
Conversation
ff262a8
to
ec788e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Do we further need to filter on the expired_at field?
@@ -40,7 +40,8 @@ class CourseEntitlementFilter(filters.FilterSet): | |||
|
|||
uuid = UUIDListFilter() | |||
user = filters.CharFilter(field_name='user__username') | |||
course_uuid = UUIDListFilter(field_name='course_uuid') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will query params character length be an issue if there is a large courseUUID list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially, yes
for entitlement in entitlements[0:3] | ||
} | ||
# Create a 2nd entitlement for one of the ones to filter on | ||
CourseEntitlementFactory.create(user=self.user, course_uuid=str(entitlements[0].course_uuid)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not get it. Could you please elaborate on why are we creating another entry with the same course UUID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted the test set to seem more realistic, because in the wild we can potentially encounter a response that has entitlements with the same course_uuid
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
EdX Release Notice: This PR has been deployed to the production environment. |
openedx#32305) * feat: allow course entitlements REST API to be filtered on course_uuid * feat: add field to filter out entitlements with null expired_at values * chore: update tests
openedx#32305) * feat: allow course entitlements REST API to be filtered on course_uuid * feat: add field to filter out entitlements with null expired_at values * chore: update tests
Description
Describe what this pull request changes, and why. Include implications for people using this change.
Design decisions and their rationales should be documented in the repo (docstring / ADR), per
OEP-19, and can be
linked here.
Useful information to include:
"Developer", and "Operator".
changes.
Supporting information
Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
Please provide detailed step-by-step instructions for testing this change.
Deadline
"None" if there's no rush, or provide a specific date or event (and reason) if there is one.
Other information
Include anything else that will help reviewers and consumers understand the change.