-
Notifications
You must be signed in to change notification settings - Fork 48
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: REST APIs (list/retrieve + learner-status
) for DefaultEnterpriseEnrollmentIntention
#2274
Conversation
f25d939
to
4d07af6
Compare
4d07af6
to
a9846dd
Compare
learner-status
) for default enterprise-enrollment intentionslearner-status
) for DefaultEnterpriseEnrollmentIntentions
learner-status
) for DefaultEnterpriseEnrollmentIntentions
learner-status
) for DefaultEnterpriseEnrollmentIntention
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'm about 30% done, enjoy these two tiny pieces of feedback! ;)
For list actions, some non-strict subset of this is what's returned by `get_queryset()`. | ||
""" | ||
kwargs = {} | ||
if self.requested_enterprise_customer_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.
You made the requested_enterprise_customer_uuid
property pretty defensive against false-iness, I think it's fine for this to be a one-liner:
return models.DefaultEnterpriseEnrollmentIntention.objects.filter(
enterprise_customer=self.requested_enterprise_customer_uuid,
)
|
||
# Validate the user for learner status exists and is associated | ||
# with the enterprise customer. | ||
if not (user_for_learner_status := self.user_for_learner_status): |
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.
nit: you could make self.user_for_learner_status
a cached_property
to avoid storing its value in a variable here.
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.
Couple of nits, great job 👍🏽
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.
This is great, I have a few more small suggestions, but it's ready to go.
Jira
CHANGELOG:
Introduces basic CRUD endpoints for the
DefaultEnterpriseEnrollmentIntention
model.GET
{LMS}/enterprise/api/v1/default-enterprise-enrollment-intentions/?enterprise_customer_uuid={enterprise_id}
Lists all
DefaultEnterpriseEnrollmentIntentions
for the specified enterprise customer.GET
{LMS}/enterprise/api/v1/default-enterprise-enrollment-intentions/{intention_uuid}/?enterprise_customer_uuid={enterprise_id}
Retrieves a single instance of
DefaultEnterpriseEnrollmentIntention
.Introduces endpoint to retrieve
DefaultEnterpriseEnrollmentIntentions
for a given enterprise customer <> enterprise learnerGET
{LMS}/enterprise/api/v1/default-enterprise-enrollment-intentions/learner-status/?enterprise_customer_uuid={enterprise_id}
Returns which enrollment intentions are already enrolled, needs enrollment (enrollable vs. not enrollable) by the request user (or, if staff, specific user as denoted by optional
lms_user_id
query parameter).Merge checklist:
requirements/*.txt
files)base.in
if needed in production but edx-platform doesn't install ittest-master.in
if edx-platform pins it, with a matching versionmake upgrade && make requirements
have been run to regenerate requirementsmake static
has been run to update webpack bundling if any static content was updated./manage.py makemigrations
has been run./manage.py lms makemigrations
in the shell.Post merge:
(so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
make upgrade
in edx-platform will look for the latest version in PyPi.