-
Notifications
You must be signed in to change notification settings - Fork 46
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
[ENT-8005]: Refactor learner data transmission audit record #1973
Conversation
f44ede3
to
fe1db64
Compare
13cd893
to
04eb42d
Compare
|
||
return [ | ||
BlackboardLearnerDataTransmissionAudit( | ||
course_id = get_course_id_for_enrollment(enterprise_enrollment) |
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.
Have we confirmed if this reutrns a course key or course run key?
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.
The course run keys have already been removed. The existing code only returns course key.
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.
Looks good but should take a second opinion from @zamanafzal before merging.
BlackboardLearnerDataTransmissionAudit( | ||
course_id = get_course_id_for_enrollment(enterprise_enrollment) | ||
# We only want to send one record per enrollment and course, so we check if one exists first. | ||
learner_transmission_record = BlackboardLearnerDataTransmissionAudit.objects.filter( |
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.
How about using get_or_create instead of checking the record?
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.
The problem is that we're not creating the record at this point but creating its model instance. As far as I know, the get_or_create
method creates the record in db. Correct me if I'm wrong because this method can make the code a lot cleaner.
JIRA Ticket: ENT-8005
Description:
Refactor learner data transmission audit records to utilize the updating record instead of creating a new one every time.
Note: Test cases for Canvas, blackboard, and Cornerstone are under progress.
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.